Merge branch 'ml/filter-branch-no-op-error'

"git filter-branch" learned to use a different exit code to allow
the callers to tell the case where there was no new commits to
rewrite from other error cases.

* ml/filter-branch-no-op-error:
  filter-branch: return 2 when nothing to rewrite
This commit is contained in:
Junio C Hamano 2018-04-10 08:25:44 +09:00
commit cb3e97dae8
2 changed files with 9 additions and 1 deletions

View File

@ -222,6 +222,14 @@ this purpose, they are instead rewritten to point at the nearest ancestor that
was not excluded. was not excluded.
EXIT STATUS
-----------
On success, the exit status is `0`. If the filter can't find any commits to
rewrite, the exit status is `2`. On any other error, the exit status may be
any other non-zero value.
Examples Examples
-------- --------

View File

@ -310,7 +310,7 @@ git rev-list --reverse --topo-order --default HEAD \
die "Could not get the commits" die "Could not get the commits"
commits=$(wc -l <../revs | tr -d " ") 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 # Rewrite the commits
report_progress () report_progress ()