git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Jeff KingNext: Junio C Hamano
Message 6 of 18 in “Issue with global config defaults "user.useConfigOnly = true" + "pull.rebase = preserve" - "user.email"”
  1. Dakota HawkinsJul 29, 2016
  2. Junio C HamanoJul 29, 2016
  3. Jeff KingJul 29, 2016
  4. Junio C HamanoJul 29, 2016
  5. Jeff KingJul 29, 2016
  6. Jeff KingJul 29, 2016
  7. Junio C HamanoJul 29, 2016
  8. Jeff KingJul 29, 2016
  9. Junio C HamanoJul 29, 2016
  10. Jeff KingJul 29, 2016
  11. Dakota HawkinsJul 30, 2016
  12. Junio C HamanoAug 11, 2016
  13. Johannes SchindelinSep 9, 2016
  14. Junio C HamanoSep 9, 2016
  15. Junio C HamanoSep 9, 2016
  16. Dakota HawkinsSep 9, 2016
  17. Junio C HamanoJul 29, 2016
  18. Jeff KingJul 29, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.