What do you do after merge in a VCS?

This is a question about software development.

The merge command puts merge markers only when there is a conflict,
resolving the conflict means to decide what code to put in its place. No
problem.

The problem is that merge automatically changes the file in some cases without
markers. For me the only way to go would be to use diff to find the changes and
review the program as a whole. But it seems that is not what software developers do.
 
Untill you check in your results, the "diff" command of the vcs should tell you what your local copy has accumulated. With vcs, you check in often, mostly to a local branch, and merge the trunk often. So the diffs are not growing out of hand.
 
Untill you check in your results, the "did" command of the vcs should tell you what your local copy has accumulated.
e.g. fossil changes or fossil diff ?
With vcs, you check in often, mostly to a local branch, and merge the trunk often. So the diffs are not growing out of hand.
Sure, that is wise, but the smaller the diff is, the easier to integrate the changes without branching (and hence merge).
 
diff is the way, yes.

Changes that rebased without conflict often continue to work as intended. And they should have automated tests anyway.
 
It depends on the VCS. On Darcs (where some of my rather ancient Perl scripts reside), "merge" == "cherry-pick" -> no problem whatsoever. On CVS, quite a few dents in the table. On Fossil, I just use diff.
 
Changes that rebased without conflict often continue to work as intended. And they should have automated tests anyway.
Then follows typical false conclusion: often -> always, specially if all tests passed.

It would be nice to have a switch for merge that makes it to mark not only "conflicts", but every change coming from foreign edits. Since one is going anyway to use diff, the fact that it is more verbose is no excuse against it.

When I search in google, it appears everywhere that the "conflicts" are the problem. They concentrate in the "conflicts".
Then I read about CI (continuous integration) as were testing the solution, not reviewing the whole. It wonders me.
Well, I just use computers as what they are, programmable machines, I am not a professional programmer.
 
One has to keep in mind on "what is a conflict". Most/all of systems I've used a conflict at base is multiple checkins that modify (change, add, delete) the same area of code.
Simplistically:
Two people make a branch off main at the same time, File A is the same. They both make modifications to the file, one person gets it merged to main. Second person continues making changes to file A without pulling changes from the first person (rebase or merge from main). Eventually second person tries to merge file A to main, but wound up making changes to a block of code (lines of code, say line 200 to 215) that first person did.
That's the conflict.

Now since changes are tracked, sometimes the tool can automatically resolve the changes, but when it can't, a person needs to resolve it.
 
One has to keep in mind on "what is a conflict".
Indeed. But I am not sure you get what I mind. Complicated explanations of something trivial awake doubts. Look:

# cat e1
000
111
# cat e2
111
# cat e3
111
222
# merge -p e1 e2 e3
000
111
222
You do not see merge markers. Your CVS will merge without "conflict". but adding 222 at the end of e1 may disrupt what e1 is meant to do, 222 could for example be code that redefine something that calculated.

It is a trivial example of a trivial flaw of these merge mechanism.

cracauer@ says "often continue to work as intended". I would never trust this "often", also not after doing tests.

Now since changes are tracked, sometimes the tool can automatically resolve the changes, but when it can't, a person needs to resolve it.
The problem is not what a person needs to "resolve", the problem is what the tool automatically "resolves".
 
You do not see merge markers. Your CVS will merge without "conflict". but adding 222 at the end of e1 may disrupt what e1 is meant to do, 222 could for example be code that redefine something that calculated.
I think this is where CI comes in if it includes tests that cover the right stuff. That is often a problem.
 
You can do it like a former coworker of mine:
  • Before rebase, copy the file with your changes away
  • Reset those files so that they rebase without any merges
  • Rebase
  • Copy your version of the files back
  • Commit
 
Before rebase
"Rebase" is a git concept. I do not know git. Things are getting complicated.
Can you explain it more general, abstract, showing what is the effect? The intention of doing that? The result?
Is the effect that the commit is a file written before, as one wants?
Then for what one needs branching and merging?
 
"Rebase" is a git concept. I do not know git. Things are getting complicated.
Can you explain it more general, abstract, showing what is the effect? The intention of doing that? The result?
Is the effect that the commit is a file written before, as one wants?
Then for what one needs branching and merging?
So you need to clarify which VCS you assume. Otherwise, no one can answer properly, as it may be VCS specific.

If you've back from long absense with FreeBSD, you could imagine subversion (svn) or even CVS. If you're from older, UCB era or old AT&T Unix, you could imagine SCCS or RCS.

Currently, all up-to-date src / ports / docs repo of FreeBSD are Git repos.
So anyone answering surely assume Git here in FreeBSD forums.
 
"Rebase" is a git concept. I do not know git. Things are getting complicated.
Can you explain it more general, abstract, showing what is the effect? The intention of doing that? The result?
Is the effect that the commit is a file written before, as one wants?
Then for what one needs branching and merging?
You can assume rebase == merge for the purpose of this discussion so far.

The problem with the procedure I described is that you silently undo other people's change without noticing. It's a sign of a bad coworker.
 
So you need to clarify which VCS you assume. Otherwise, no one can answer properly, as it may be VCS specific.
If you think, to assume a concrete VCS is necessary, then you did not understand the question.
It is about diff3 / merge. I think every VCS has an operation with it.

The problem with the procedure I described is that you silently undo other people's change without noticing. It's a sign of a bad coworker.
And hence imposing the own files. Perhaps a person desperate with git and work pressure.
 
You can do it like a former coworker of mine:
  • Before rebase, copy the file with your changes away
  • Reset those files so that they rebase without any merges
  • Rebase
  • Copy your version of the files back
  • Commit
  • Get found out about
  • Get a stern talking from your PL
  • Repeat, get an appointment with HR
 
Back
Top