{"thread":{"id":"3942","subject":"[PATCH] do not use the no-op \"-s\" to diff-files.","startedAt":"2006-04-22T07:49:46Z","lastAt":"2006-04-22T07:49:46Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"18990","messageId":"7v1wvqnj6t.fsf@assigned-by-dhcp.cox.net","threadId":"3942","inReplyTo":null,"subject":"[PATCH] do not use the no-op \"-s\" to diff-files.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-22T07:49:46Z","receivedAt":"2006-04-22T07:49:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The code to use '-s' flag to git-diff-files has been in cg-merge\n(and its ancestor) since this commit:\n\n    commit 39c1ae5dfd229fb87c723fcf9737f29a506a31f9\n    Author: Petr Baudis <pasky@ucw.cz>\n    Date:   Tue Apr 19 02:42:08 2005 +0200\n\nThe \"-s\" flag has been a no-op to git-diff-files (but not for\nother diff siblings) for quite some time.  For other diff\nsiblings, the flag means \"do not output anything\", and it is\nprimarily useful to squelch patch/raw from one-tree form of\n\"diff-tree --pretty\".\n\nI am not sure if running diff-files to see if there is any\ndifference and then running update-index --refresh when it is is\na win -- I suspect you did this out of performance concerns, but\nit might be faster to let update-index to figure out if there is\nanything that needs to be done.  So the first variant is the\nminimum impact (absolutely no semantic changes), the second\nvariant _might_ be a performance improvement.\n\n-jc\n\n-- >8 --\nFirst variant\n\ndiff --git a/cg-merge b/cg-merge\nindex 004b78a..24fb6ca 100755\n--- a/cg-merge\n+++ b/cg-merge\n@@ -199,7 +199,7 @@ if { [ \"$head\" = \"$base\" ] || [ \"$head\" \n fi\n \n \n-[ \"$(git-diff-files -s)\" ] && git-update-index --refresh >/dev/null\n+[ \"$(git-diff-files)\" ] && git-update-index --refresh >/dev/null\n \n if [ ! \"$squash\" ]; then\n \t[ -s \"$_git/squashing\" ] && die \"cannot combine squashing and non-squashing merges\"\n\n-- >8 --\nSecond variant\n\ndiff --git a/cg-merge b/cg-merge\nindex 24fb6ca..938d21a 100755\n--- a/cg-merge\n+++ b/cg-merge\n@@ -199,7 +199,7 @@ if { [ \"$head\" = \"$base\" ] || [ \"$head\" \n fi\n \n \n-[ \"$(git-diff-files -s)\" ] && git-update-index --refresh >/dev/null\n+git-update-index --refresh >/dev/null\n \n if [ ! \"$squash\" ]; then\n \t[ -s \"$_git/squashing\" ] && die \"cannot combine squashing and non-squashing merges\"\n"}]}