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

Re: commiting while the current version is in conflict

From
Junio Hamano <junio@twinsun.com>
Date
Oct 16, 2008, 23:39 UTC
Message-ID
<7vy70of6t2.fsf@arte.twinsun.com>
> Judging from the code in the pre-commit script, git does not
> keep conflict information in its metadata cache, but tries to guess
> conflicts from the file's contents/ This seems to be a strange
> thing to do, imo. What's the reason for this?
Because 
 (0) You are wrong to assume that git does not keep conflict
     information; we can tell if the index is "unmerged" to see
     if you still have unresolved conflicts;
 (1) When the index is unmerged, git-commit will stop even
     before getting to pre-commit hook, so there is no point
     for pre-commit hook to check if the index is unmerged;
 (2) pre-commit hook is a last ditch effort to help ignorant
     users who have already done "git add" without thinking and
     lost the "unmerged" state.  It has to look at and guess at
     the contents for that.
Next: Richard Hartmann
Message 1 of 7 in “Re: commiting while the current version is in conflict”
  1. Junio HamanoOct 16, 2008
  2. Richard HartmannOct 17, 2008
  3. Junio C HamanoOct 17, 2008
  4. Richard HartmannOct 17, 2008
  5. Jakub NarebskiOct 17, 2008
  6. Richard HartmannOct 17, 2008
  7. Junio C HamanoOct 17, 2008

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.