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

Re: git add -p and unresolved conflicts

From
HHHolger Hellmuth <hellmuth@ira.uka.de>
Date
Mar 28, 2012, 19:14 UTC
Message-ID
<4F73632E.1060408@ira.uka.de>
In-Reply-To
<vpqvclozr7e.fsf@bauges.imag.fr>
On 28.03.2012 17:21, Matthieu Moy wrote:
Show 7 quoted lines
> Junio C Hamano<gitster@pobox.com>  writes:
>
>> I mildly suspect nobody would come up with a sane behaviour, but what
>> would I know...
>
> Designing a per-hunk behavior would clearly be very tricky.
>
I don't think it's that tricky:

For a conflicted file show any conflicted hunks first(!) and only provide the following options for them: q - quit, do not stage... d - do not stage this hunk nor any of the remaining hunks in the file e - manually edit the current hunk ? - print help

and additionally the following three options:
b - choose the base version
< - choose our version
 > - choose their version
< and > correspond to the conflict markers, alternatives would be o and t

The user now has the option to remove the conflicts (through editing or choosing one of the versions) or abort adding the file.

The tricky part might be sorting the hunks so that conflicts are first (depending on how the code works now), choosing the right version in a hunk (the three new options) should be relatively easy.

Previous: Matthieu MoyNext: Junio C Hamano
Message 4 of 21 in “git add -p and unresolved conflicts”
  1. Erik Faye-LundMar 28, 2012
  2. Junio C HamanoMar 28, 2012
  3. Matthieu MoyMar 28, 2012
  4. Holger HellmuthMar 28, 2012
  5. Junio C HamanoMar 28, 2012
  6. Holger HellmuthMar 28, 2012
  7. Jeff KingMar 29, 2012
  8. Holger HellmuthMar 29, 2012
  9. Matthieu MoyMar 28, 2012
  10. Junio C HamanoMar 28, 2012
  11. Holger HellmuthMar 28, 2012
  12. Junio C HamanoMar 28, 2012
  13. Holger HellmuthMar 28, 2012
  14. Junio C HamanoMar 28, 2012
  15. Junio C HamanoMar 28, 2012
  16. Holger HellmuthMar 29, 2012
  17. Matthieu MoyMar 29, 2012
  18. Junio C HamanoMar 29, 2012
  19. Matthieu MoyMar 30, 2012
  20. Erik Faye-LundMar 28, 2012
  21. Junio C HamanoMar 28, 2012

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.