git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rebase: Squelch the "fatal: Not an error." message
@ 2010-03-24  0:03 Kevin Ballard
  2010-03-25 21:24 ` Kevin Ballard
  2010-03-26 19:25 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Kevin Ballard @ 2010-03-24  0:03 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]

When `git rebase --onto newbase upstream` is executed with
upstream being equal to the current commit, `git rebase` will
call `git format-patch` with "upstream..upstream" as the commits
to generate patches for. This causes a spurious error message to
be thrown which should be squelched.

Signed-off-by: Kevin Ballard <kevin@sb.org>
---
This patch was inspired by a common error encountered when using `git pull --rebase`, particularly in the case where there are no local commits that need rebasing and the fetched head was a force-pushed history modification (e.g. from git filter-branch). The error itself is actually caused by running `git rebase --onto newbase upstream` where upstream is the same commit as HEAD. This causes `git format-patch` to be called with "upstream..upstream" as the range and it complains. My solution was to squelch all errors from `git format-patch`, though I am unsure if the "fatal: Not a range." error is the only error that can be raised in this situation.

git-rebase.sh |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


[-- Attachment #2: 0001-rebase-Squelch-the-fatal-Not-an-error.-message.patch --]
[-- Type: text/x-patch, Size: 403 bytes --]

diff --git a/git-rebase.sh b/git-rebase.sh
index e0eb956..8868dee 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -544,7 +544,7 @@ fi
 if test -z "$do_merge"
 then
 	git format-patch -k --stdout --full-index --ignore-if-in-upstream \
-		$root_flag "$revisions" |
+		$root_flag "$revisions" 2>/dev/null |
 	git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
 	move_to_original_branch
 	ret=$?

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

end of thread, other threads:[~2010-03-30  2:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24  0:03 [PATCH] rebase: Squelch the "fatal: Not an error." message Kevin Ballard
2010-03-25 21:24 ` Kevin Ballard
2010-03-26 19:25 ` Junio C Hamano
2010-03-26 23:31   ` Kevin Ballard
2010-03-27  0:08     ` Kevin Ballard
2010-03-30  2:46       ` [PATCH] format-patch: Squelch 'fatal: Not a range." error Kevin Ballard

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).