git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-submodule: Remove duplicate entries during merge with conflict
@ 2011-03-17  8:09 Nicolas Morey-Chaisemartin
  2011-03-17 18:47 ` Junio C Hamano
  2011-07-14 18:33 ` funeeldy
  0 siblings, 2 replies; 14+ messages in thread
From: Nicolas Morey-Chaisemartin @ 2011-03-17  8:09 UTC (permalink / raw)
  To: git

During a merge with conflict on a submodule, the submodule appears 3 times in git ls-files (stage 1,2,3) which causes the submodule to be used 3 times in git submodule update or status command.
This patch filters the results of git ls-files and only shows submodule in stage 0 or 1 thus removing the duplicates.

Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
---
 git-submodule.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-submodule.sh b/git-submodule.sh
index 3a13397..5ef0f9d 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -72,7 +72,7 @@ resolve_relative_url ()
 #
 module_list()
 {
-	git ls-files --error-unmatch --stage -- "$@" | sane_grep '^160000 '
+	git ls-files --error-unmatch --stage -- "$@" | sane_grep '^160000 ' | awk '{ if (($3 == 0) || ($3 == 1)) print $0}'
 }
 
 #

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

end of thread, other threads:[~2011-07-15 21:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-17  8:09 [PATCH] git-submodule: Remove duplicate entries during merge with conflict Nicolas Morey-Chaisemartin
2011-03-17 18:47 ` Junio C Hamano
2011-03-17 20:50   ` Junio C Hamano
2011-03-21  8:43     ` Nicolas Morey-Chaisemartin
2011-03-21 20:53       ` Jens Lehmann
2011-03-21 20:29     ` Jens Lehmann
2011-03-21 20:59       ` Junio C Hamano
2011-03-21 21:34       ` Nicolas Morey-Chaisemartin
2011-03-21 22:01         ` Jens Lehmann
2011-03-22  6:28           ` Nicolas Morey-Chaisemartin
2011-07-14 18:33 ` funeeldy
2011-07-15 19:27   ` Jens Lehmann
2011-07-15 20:32     ` Marlene Cote
2011-07-15 21:41       ` Jens Lehmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).