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

git format-patch with useAutoBase = true

From
Jacob Keller <jacob.keller@gmail.com>
Date
Sep 15, 2020, 00:13 UTC
Message-ID
<CA+P7+xpjSxEmB0qpWkhkd=yeA9xF-ssVdW1J5NyJdkqfza=GPg@mail.gmail.com>
Hi,
I just ran into a surprising and unexpected issue with git format-patch.

$ git format-patch -1 f7529b4ba3c98470b0e367ba447ad0da84dc308 fatal: base commit shouldn't be in revision list

It took me about 15 minutes to figure out this was referring to the fact that I have "useAutoBase" set to true in the git config, so that I get --base=auto by default.

It turns out, that if you, while this config is active, try to format an ancient patch that is historical, you will get this failure. Because --base wasn't specified on the command line, this made it very unintuitive what was going wrong.

(I started to try a git bisect thinking it was a some bug in my current version of git from the repo, which still failed..)

The failure occurs because the "automatic" base is newer than the requested commit. I am wondering if it would make sense to relax this restriction and make the format-patch automatically disable useAutoBase if it would conflict like this?

At the very least it would be helpful if the error message was more intuitive and potentially explained what was going on a bit better... :)

Thanks, Jake

Next: Junio C Hamano
Message 1 of 2 in “git format-patch with useAutoBase = true”
  1. Jacob KellerSep 15, 2020
  2. Junio C HamanoSep 15, 2020

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.