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

Re: commiting while the current version is in conflict

From
Avery Pennarun <apenwarr@gmail.com>
Date
Oct 17, 2008, 01:16 UTC
Message-ID
<32541b130810161816r1667f018paa74525091f0682a@mail.gmail.com>
In-Reply-To
<2d460de70810161626n4f4c4489k489b20f2e6cce186@mail.gmail.com>

On Thu, Oct 16, 2008 at 7:26 PM, Richard Hartmann <richih.mailinglist@gmail.com> wrote:

Show 10 quoted lines
> On Fri, Oct 17, 2008 at 01:00, Shawn O. Pearce <spearce@spearce.org> wrote:
>> and merge conflicts are "resolved" by you running "git add $path"
>> after you have finished fixing that path.
>
> True, git add is an implicit resolving, I did not think about it this way.
> Personally, I think that git should break at this point, but that's
> just me.
>
> The obvious fix would be a pre-add hook. Does anyone else think
> this would make sense?

That would be awesome. I've frequently been bitten by accidentally running "git add" on a file that I *think* I've resolved the conflicts on, but it turns out I missed a commit marker or two. And then the handy conflict-style "git diff" is no longer available, among other things. If "git add" could prevent me from adding the file at all, it might save me some trouble.

On the other hand, an even better alternative would be to have a way to "unadd" a file and bring back the conflict information, but I don't know how that would really work.

Have fun,
Avery
Previous: Richard HartmannNext: Richard Hartmann
Message 5 of 10 in “commiting while the current version is in conflict”
  1. Richard HartmannOct 16, 2008
  2. Miklos VajnaOct 16, 2008
  3. Shawn O. PearceOct 16, 2008
  4. Richard HartmannOct 16, 2008
  5. Avery PennarunOct 17, 2008
  6. Richard HartmannOct 16, 2008
  7. Shawn O. PearceOct 16, 2008
  8. Richard HartmannOct 16, 2008
  9. Jakub NarebskiOct 16, 2008
  10. Richard HartmannOct 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.