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

Re: [PATCH] add -p: skip conflicted paths

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Apr 4, 2012, 12:50 UTC
Message-ID
<CALUzUxoOcncBnMcuA0hGzu=1P=8e7GbqoNNFO7M584YGDKYPRQ@mail.gmail.com>
In-Reply-To
<20120404094618.GA13870@sigill.intra.peff.net>
On Wed, Apr 4, 2012 at 5:46 PM, Jeff King <peff@peff.net> wrote:
> I do still think it would be nicer to pass the information out to the
> caller instead of just filtering. So combining the two patches, we have
> something like:
Thanks Maestros! This has been bugging me for some time.

I gave the combined patch a shot with a trivial conflict, and it gave me "Only binary files changed". Turns out this only happens with a tree that has a only conflicted files; with a tree that has a mixed of conflicted and modified paths, it doesn't show up.

Below is a quick and dirty fix:
-->8--
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 28d36f7..96f12ca 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1207,6 +1207,7 @@ sub patch_update_cmd {

        print colored $error_color, "ignoring unmerged: $_->{VALUE}\n"
                for grep { $_->{UNMERGED} } @mods;
+       @all_mods = grep { !$_->{UNMERGED} } @all_mods;
        @mods = grep { !$_->{UNMERGED} } @mods;

        if (!@mods) {
--
-- 
Cheers,
Ray Chuan
Previous: Jeff KingNext: Junio C Hamano
Message 11 of 16 in “add -p: skip conflicted paths”
  1. add -p: skip conflicted pathsErik Faye-Lund, Mar 28, 2012
  2. Junio C HamanoMar 28, 2012
  3. add -p: skip conflicted pathsErik Faye-Lund, Mar 28, 2012
  4. Junio C HamanoMar 28, 2012
  5. Junio C HamanoMar 28, 2012
  6. Junio C HamanoMar 28, 2012
  7. Jeff KingMar 29, 2012
  8. Erik Faye-LundApr 2, 2012
  9. Junio C HamanoApr 2, 2012
  10. Jeff KingApr 4, 2012
  11. Tay Ray ChuanApr 4, 2012
  12. Junio C HamanoApr 4, 2012
  13. Junio C HamanoApr 4, 2012
  14. Jeff KingApr 4, 2012
  15. Junio C HamanoApr 4, 2012
  16. Jeff KingApr 5, 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.