* [PATCH] do not use the no-op "-s" to diff-files.
@ 2006-04-22 7:49 Junio C Hamano
0 siblings, 0 replies; only message in thread
From: Junio C Hamano @ 2006-04-22 7:49 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
The code to use '-s' flag to git-diff-files has been in cg-merge
(and its ancestor) since this commit:
commit 39c1ae5dfd229fb87c723fcf9737f29a506a31f9
Author: Petr Baudis <pasky@ucw.cz>
Date: Tue Apr 19 02:42:08 2005 +0200
The "-s" flag has been a no-op to git-diff-files (but not for
other diff siblings) for quite some time. For other diff
siblings, the flag means "do not output anything", and it is
primarily useful to squelch patch/raw from one-tree form of
"diff-tree --pretty".
I am not sure if running diff-files to see if there is any
difference and then running update-index --refresh when it is is
a win -- I suspect you did this out of performance concerns, but
it might be faster to let update-index to figure out if there is
anything that needs to be done. So the first variant is the
minimum impact (absolutely no semantic changes), the second
variant _might_ be a performance improvement.
-jc
-- >8 --
First variant
diff --git a/cg-merge b/cg-merge
index 004b78a..24fb6ca 100755
--- a/cg-merge
+++ b/cg-merge
@@ -199,7 +199,7 @@ if { [ "$head" = "$base" ] || [ "$head"
fi
-[ "$(git-diff-files -s)" ] && git-update-index --refresh >/dev/null
+[ "$(git-diff-files)" ] && git-update-index --refresh >/dev/null
if [ ! "$squash" ]; then
[ -s "$_git/squashing" ] && die "cannot combine squashing and non-squashing merges"
-- >8 --
Second variant
diff --git a/cg-merge b/cg-merge
index 24fb6ca..938d21a 100755
--- a/cg-merge
+++ b/cg-merge
@@ -199,7 +199,7 @@ if { [ "$head" = "$base" ] || [ "$head"
fi
-[ "$(git-diff-files -s)" ] && git-update-index --refresh >/dev/null
+git-update-index --refresh >/dev/null
if [ ! "$squash" ]; then
[ -s "$_git/squashing" ] && die "cannot combine squashing and non-squashing merges"
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-04-22 17:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-22 7:49 [PATCH] do not use the no-op "-s" to diff-files 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;
as well as URLs for NNTP newsgroup(s).