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

Re: [BUG] [RESOLVED] merge-recursive call in git-am -3 chokes, autocrlf issue?

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 1, 2010, 17:27 UTC
Message-ID
<7vbpe3qe09.fsf@alter.siamese.dyndns.org>
In-Reply-To
<hp2jkj$mu0$1@dough.gmane.org>
"Scott R. Godin" <scottg.wp-hackers@mhg2.com> writes:
Show 7 quoted lines
> So my recommendation at this point is to patch the instructions within
> setgitperms.perl to add 'git update-index --refresh' to the end of the
> post-checkout hook.
>
> I've since reset git-am to use recursive again (instead of resolve)
> and done several rebases (both with and without -i) and all seems well
> and normal, and this has made my day.

Ahh. If you muck with work tree files and the index in pre-commit, post-merge, or post-checkout hook (especially if you make an up-to-date work tree file stat-dirty), I can imagine that you would need to "refresh" so that unchanged paths would appear unchanged in the index not to confuse your caller.

I however think the patch probably "fixes" the issue at the worst point. Wouldn't either of these alternatives be better?

 (1) Perhaps the caller of "pre-commit/post-merge/post-checkout" hook
     should instead refresh the index when the hook returns, _iff_ we
     expect that majority of these hooks are used to munge the work tree
     or the index; or
 (2) Because you already established that setgitperms script is the
     culprit that leaves the index unrefreshed, instead of forcing all the
     callers of the script, it should do the refresh for its callers
     before it exits.
Previous: Scott R. GodinNext: Scott R. Godin
Message 3 of 6 in “[BUG] merge-recursive call in git-am -3 chokes, autocrlf issue?”
  1. Thomas RastMar 19, 2010
  2. Scott R. GodinApr 1, 2010
  3. Junio C HamanoApr 1, 2010
  4. Scott R. GodinMay 4, 2010
  5. setgitperms.perl dirty index problem (was Re: [BUG] [RESOLVED] merge-recursive call in git-am -3 chokes, autocrlf issue?)Scott R. Godin, May 24, 2010
  6. Junio C HamanoMay 25, 2010

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.