Re: Issue with global config defaults "user.useConfigOnly = true" + "pull.rebase = preserve" - "user.email"
- From
Jeff King <peff@peff.net>
- Date
- Jul 29, 2016, 18:52 UTC
- Message-ID
- <20160729185211.GA5591@sigill.intra.peff.net>
- In-Reply-To
- <20160729183911.GA10268@sigill.intra.peff.net>
On Fri, Jul 29, 2016 at 02:39:11PM -0400, Jeff King wrote:
> From my limited testing, "git pull --rebase" is perfectly fine. The > culprit is "--rebase=preverse", which complains even if it would be a > fast-forward.
That should be preserve, of course. :)
And I think I see what is happening. "preserve" implies interactive-rebase, which makes an early check that we have valid committer info, even though we might not actually write any new commits.
So doing this:
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index ded4595..f0f4777 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -1180,9 +1180,6 @@ To continue rebase after editing, run: ;; esac -git var GIT_COMMITTER_IDENT >/dev/null || - die "$(gettext "You need to set your committer info first")" - comment_for_reflog start if test ! -z "$switch_to" fixes it for me. I can't figure out if that would have any bad side effects, though. That check comes from Dscho's original 1b1dce4 (Teach rebase an interactive mode, 2007-06-25), so there's not much comment on why it was added specifically. We would notice the bogus ident later when we actually do try to create a commit object, but I can guess that this up-front check might give us a better error message. You get warned up-front, rather than something like: Rebasing (1/1) *** Please tell me who you are. [...] fatal: no name was given and auto-detection is disabled Could not pick 8ebea123853128ca2411b2b449f76a1a4b0d026c and dumped in the middle of an interactive rebase that you cannot complete. OTOH, that is how a regular non-interactive merge works. And if your next step is to set up your ident, then it's natural to do: git config user.email whatever git rebase --continue So I'd lean towards dropping it, but maybe there are other hidden gotchas. -Peff