Re: Why doesn't git-rerere automatically commit a resolution?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Shawn Pearce <spearce@xxxxxxxxxxx> writes:

> I'm curious... I have a pair of topic branches which don't merge
> together cleanly by recursive (due to conflicting hunks in the
> same line segments).  I enabled git-rerere, ran the merge, fixed
> up the hunks and committed it.  git-rerere built its cache, as
> the next time I pulled the two topic branches together and got
> the same conflicts it correctly regenerated the prior resolution
> (and printed a message saying as much).

After all your merge is conflicting, so it should be sanity
checked.  At least you would want to run a compile test and
preferably a whole test cycle if your project has one, before
making the result into a commit.

You _could_ make it to automatically make a commit, and run a
test then if the test does not succeed fix the mismerge with "git
commit --amend", but people are lazy.

> So I'm wondering why doesn't it try to finish the merge?  Was there
> a really deep rooted reason behind it or was it simply easier/safer
> to let the user sort out the working directory state every time?

The philosophy is to optimize the tools to support disciplined
workflows better, and make sure that the users do not have to
worry about automated tools makeing mismerges.

Now, I am not against helping lazy workflows per se, but only on
one condition.  Doing so should never make more disciplined
workflows harder or more difficult.

Not merging the index after rerere re-applies a previous
resolution to the working tree file is a deliberate design
decision.  During conflict resolution, "git diff" against
unmerged index file is the second most useful command to check
your hand-merge result, and running update-index on these path
automatically robs this useful tool from the user.  So, in order
to help more disciplined workflow, a bit of convenience for
lazier people is sacrficed here.

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]