Git development
 help / color / mirror / Atom feed
* [PATCH 0/4] git add --resolved
@ 2026-07-28 21:52 Junio C Hamano
  2026-07-28 21:52 ` [PATCH 1/4] merge-ll: consolidate conflict marker scanning logic Junio C Hamano
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Junio C Hamano @ 2026-07-28 21:52 UTC (permalink / raw)
  To: git

When you are the maintainer of a project and make many merges day
in, day out, a lot of your time is spent resolving conflicts and
adding the results to the index.  It is not unusual to have local
changes in your working tree that are unrelated to any particular
merge [*].  In such cases, 'git add -u', which adds all changes in
the working tree to the index, does not help much.

Here is a new option for 'git add' that lets you add paths with
resolved conflicts to the index, while keeping unrelated local
changes out.

The first two patches perform preliminary refactorings.

 - [1/4] consolidates a helper function to determine whether a line
   is a conflict marker (replacing two slightly different
   definitions).

 - [2/4] introduces a helper that makes registering path removals
   from the index as easy as adding them, complete with automatic
   '--dry-run' and '--verbose' support.

The third patch implements the new feature.

The fourth patch is a totally unrelated code cleanup that almost
disappears when viewed with 'git show -w'.

 1/4: merge-ll: consolidate conflict marker scanning logic
 2/4: read-cache: add remove_file_from_index_with_flags()
 3/4: add: introduce '--resolved' option
 4/4: read-cache: reindent

[Footnote]

 * This is not limited to my own workflow. An earlier message on
   this topic worth mentioning is:

   https://lore.kernel.org/git/CA+55aFxP8j7YbYaRXt-8Y0n8cHafB=FPKMy8gKFYH5QsKX4S=Q@mail.gmail.com/


 Documentation/git-add.adoc |  10 +++-
 builtin/add.c              |  92 ++++++++++++++++++++++++++++---
 diff.c                     |  25 +--------
 merge-ll.c                 |  53 ++++++++++++++++++
 merge-ll.h                 |   2 +
 read-cache-ll.h            |   3 ++
 read-cache.c               |  89 +++++++++++++++++-------------
 rerere.c                   |  38 +++----------
 t/t2207-add-resolved.sh    | 108 +++++++++++++++++++++++++++++++++++++
 9 files changed, 319 insertions(+), 101 deletions(-)
 create mode 100755 t/t2207-add-resolved.sh

-- 
2.55.0-594-g42d2bf033e


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-07-29 17:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28 21:52 [PATCH 0/4] git add --resolved Junio C Hamano
2026-07-28 21:52 ` [PATCH 1/4] merge-ll: consolidate conflict marker scanning logic Junio C Hamano
2026-07-28 21:52 ` [PATCH 2/4] read-cache: add remove_file_from_index_with_flags() Junio C Hamano
2026-07-28 21:52 ` [PATCH 3/4] add: introduce '--resolved' option Junio C Hamano
2026-07-29  3:28   ` Michael Montalbo
2026-07-29 13:43     ` Junio C Hamano
2026-07-29 13:49       ` Junio C Hamano
2026-07-29 15:01   ` Junio C Hamano
2026-07-28 21:52 ` [PATCH 4/4] read-cache: reindent Junio C Hamano
2026-07-29 17:25 ` [PATCH v2 0/4] git add --resolved Junio C Hamano
2026-07-29 17:25   ` [PATCH v2 1/4] read-cache: reindent Junio C Hamano
2026-07-29 17:25   ` [PATCH v2 2/4] merge-ll: consolidate conflict marker scanning logic Junio C Hamano
2026-07-29 17:25   ` [PATCH v2 3/4] read-cache: add remove_file_from_index_with_flags() Junio C Hamano
2026-07-29 17:25   ` [PATCH v2 4/4] add: introduce '--resolved' option Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox