git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <junkio@cox.net>
Date
Jul 11, 2006, 06:58 UTC
Message-ID
<7v8xn06310.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060711061626.GB11822@spearce.org>
Shawn Pearce <spearce@spearce.org> writes:
Show 7 quoted lines
> 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.

Previous: Shawn PearceNext: Shawn Pearce
Message 2 of 4 in “Why doesn't git-rerere automatically commit a resolution?”
  1. Shawn PearceJul 11, 2006
  2. Junio C HamanoJul 11, 2006
  3. Shawn PearceJul 11, 2006
  4. Matthias KestenholzJul 11, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.