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

[PATCH 0/7] unresolve removal

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 31, 2023, 22:44 UTC
Message-ID
<20230731224409.4181277-1-gitster@pobox.com>

This series is a culmination of various draft patches I have sent out recently and have queued in two topics near the tip of 'seen'.

The primary objective is to allow undoing conflict resolution that was done via "git rm". When a conflicted path is resolved with "git add" (i.e. replace higher stage index entries with stage #0 entry), "git checkout -m -- path" and "git update-index --unresolve path" worked using the resolve-undo information stored in the index, but a conflicted path that is resolved with "git rm" (i.e. remove higher stage index, without adding any stage #0 entry for the path), these two commands did not work at all, or did not function correctly.

Junio C Hamano (7):
  update-index: do not read HEAD and MERGE_HEAD unconditionally
  resolve-undo: allow resurrecting conflicted state that resolved to
    deletion
  update-index: use unmerge_index_entry() to support removal
  update-index: remove stale fallback code for "--unresolve"
  checkout/restore: refuse unmerging paths unless checking out of the
    index
  checkout/restore: add basic tests for --merge
  checkout: allow "checkout -m path" to unmerge removed paths
 Documentation/git-checkout.txt |   9 ++-
 Documentation/git-restore.txt  |   4 ++
 builtin/checkout.c             |  15 +++--
 builtin/update-index.c         |  98 ++++----------------------------
 rerere.c                       |   2 +-
 resolve-undo.c                 | 101 ++++++++++++---------------------
 resolve-undo.h                 |   5 +-
 t/t2030-unresolve-info.sh      |  45 +++++++++++++--
 t/t2070-restore.sh             |  71 ++++++++++++++++++++++-
 t/t7201-co.sh                  |  47 +++++++++++++++
 10 files changed, 230 insertions(+), 167 deletions(-)
-- 
2.41.0-478-gee48e70a82
Next: Junio C Hamano
Message 1 of 10 in “unresolve removal”
  1. 0/7 unresolve removalJunio C Hamano, Jul 31, 2023
  2. 3/7 update-index: use unmerge_index_entry() to support removalJunio C Hamano, Jul 31, 2023
  3. Junio C HamanoJul 31, 2023
  4. 2/7 resolve-undo: allow resurrecting conflicted state that resolved to deletionJunio C Hamano, Jul 31, 2023
  5. 4/7 update-index: remove stale fallback code for "--unresolve"Junio C Hamano, Jul 31, 2023
  6. 6/7 checkout/restore: add basic tests for --mergeJunio C Hamano, Jul 31, 2023
  7. 7/7 checkout: allow "checkout -m path" to unmerge removed pathsJunio C Hamano, Jul 31, 2023
  8. 1/7 update-index: do not read HEAD and MERGE_HEAD unconditionallyJunio C Hamano, Jul 31, 2023
  9. 5/7 checkout/restore: refuse unmerging paths unless checking out of the indexJunio C Hamano, Jul 31, 2023
  10. Taylor BlauAug 4, 2023

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.