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, 20:10 UTC
Message-ID
<4F737027.5020503@ira.uka.de>
In-Reply-To
<vpqk424zfb1.fsf@bauges.imag.fr>
On 28.03.2012 21:38, Matthieu Moy wrote:
Show 10 quoted lines
> Holger Hellmuth<hellmuth@ira.uka.de>  writes:
>
>> and additionally the following three options:
>> b - choose the base version
>> <  - choose our version
>>> - choose their version
>
> What does it mean to "choose" in this context? In general, it means "put
> this into the index", but if the file is in conflicted state, you have 3
> different versions of the file in the index.

The only ways to exit with the proposed reduced options is to either quit adding this file (which is comparable to Eriks option 4) or resolving all conflicts in the file thereby allowing to add this file to the index.

> And you miss the most usefull (to me at least): "choose the version in
> the worktree".
>

But the conflicted chunks are of the form "<<<< our ... |||||||||| theirs >>>>>>" in your work tree. So there are two cases:

a) You have removed the markers thereby removing the conflict -> this means the chunk will not be offered to you as a conflicting chunk

b) You haven't removed the markers. Then there is a choice between base, our and their version. If you had edited one of the versions between the conflict markers in your working tree without removing the markers (which wouldn't be a sensible thing) then it depends on whether the chunk in the working tree or the versions in the index are used as a basis for the choosing, but I suspect using the working tree version is easier to do.

Previous: Junio C HamanoNext: Junio C Hamano
Message 11 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.