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:11 UTC
Message-ID
<20160729181121.GB14953@sigill.intra.peff.net>
In-Reply-To
<xmqqoa5gnxow.fsf@gitster.mtv.corp.google.com>
On Fri, Jul 29, 2016 at 10:47:27AM -0700, Junio C Hamano wrote:
Show 16 quoted lines
> > In those cases specifically, I never have local commits that differ
> > from the remote, so a "pull --ff-only" should leave me in the same
> > state as a "pull --rebase".
> >
> > Is this a case of rebase trying to make sure it has enough information
> > for me to be a committer before knowing whether I even need to rewrite
> > any commits, and could/should that be avoided?  Alternatively (or also)
> > could/should rebase detect that a fast-forward is possible and prefer
> > to do that instead?
> 
> I think that is a reasonable argument, but to solve this for a more
> general case, shouldn't we be discussing a solution that would also
> work when rebase _does_ need to create a new commit?  And when the
> latter is solved, I would imagine that "this rebase happens to be
> fast-forward, and not having an ident shouldn't be an issue for this
> special case" would become moot.

Wouldn't it be wrong to create a commit with non-config ident when user.useConfigOnly is set, though? That is the exact point when it should kick in, to tell the user "you thought it would not matter here, but in this case we _do_ need your real ident; what should we do?"

If the user is doing a one-off thing where they do not care if their crappy, fake ident makes it into a commit object, then the right thing is:

  git -c user.useConfigOnly=false pull --rebase
or even:
  git -c user.email=fake-but-ok@example.com pull --rebase

And they can do that preemptively for commands like the golang example here. They shouldn't _have_ to do that, though, if the command wouldn't actually create a commit. So I do think there may be a bug to be fixed, but it is simply commands being over-eager to make sure we have an ident when they might not need it.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.