All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] filter-branch: return 2 when nothing to rewrite
@ 2018-03-15 13:03 Michele Locati
  2018-03-15 14:12 ` Jeff King
  2018-03-15 17:09 ` [PATCH v2] " Michele Locati
  0 siblings, 2 replies; 12+ messages in thread
From: Michele Locati @ 2018-03-15 13:03 UTC (permalink / raw)
  To: git; +Cc: Michele Locati

Using the --state-branch option allows us to perform incremental filtering.
This may lead to having nothing to rewrite in subsequent filtering, so we need
a way to recognize this case.
So, let's exit with 2 instead of 1 when this "error" occurs.

Signed-off-by: Michele Locati <michele@locati.it>
---
 git-filter-branch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 1b7e4b2cd..c285fdb90 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -310,7 +310,7 @@ git rev-list --reverse --topo-order --default HEAD \
 	die "Could not get the commits"
 commits=$(wc -l <../revs | tr -d " ")
 
-test $commits -eq 0 && die "Found nothing to rewrite"
+test $commits -eq 0 && die_with_status 2 "Found nothing to rewrite"
 
 # Rewrite the commits
 report_progress ()
-- 
2.16.2.windows.1


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

end of thread, other threads:[~2018-03-15 17:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-15 13:03 [PATCH] filter-branch: return 2 when nothing to rewrite Michele Locati
2018-03-15 14:12 ` Jeff King
2018-03-15 14:57   ` Michele Locati
2018-03-15 15:35     ` Jeff King
2018-03-15 15:42   ` Junio C Hamano
2018-03-15 15:48     ` Jeff King
2018-03-15 15:55       ` Junio C Hamano
2018-03-15 16:18         ` Michele Locati
2018-03-15 16:24           ` Jeff King
2018-03-15 17:09 ` [PATCH v2] " Michele Locati
2018-03-15 17:58   ` Junio C Hamano
2018-03-15 17:59   ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.