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

Re: bisect does not respect 'log.date'

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2024, 21:49 UTC
Message-ID
<xmqq1q7ygex1.fsf@gitster.g>
In-Reply-To
<25d716fa-bd32-4ff0-20f2-05ff51750911@softwolves.pp.se>
Peter Krefting <peter@softwolves.pp.se> writes:
> The question is what is the correct way of fixing this; is it to make
> "git diff-tree --pretty" respect the "log.date" option, or to make

The "diff-tree" and other "plumbing" commands deliberately ignore configuration and the point of doing so is to make sure their output are stable without getting affected by the end-user configuration.

> "git bisect" pass a --date pate parameter to the invocation of it?

If we were to change how "bisect" reports the date of the commit, this is a more reasonable route to go.

Are you sure that nobody is driving "git bisect" from a script and scraping the output in such a way that a change in the output format would break such a script? I would say it is unlikely (they may be scraping the output to find a commit by looking for 40-hex string, though) that it would cause such a breakage.

But stepping back a bit.

If "git bisect" were written in the more modern era, I am reasonably sure that it wouldn't have used "git diff-tree" when reporting the "first bad commit". It would have used "git show" instead, which is at the Porcelain level and will pay attention to the configuration variables. Instead of focusing too narrowly on the log.date option, that would only tweak the date format, it may be a more fruitful way to invest brainwaves in to consider the feasibility of switching to use "git show" there.

Previous: Peter KreftingNext: Peter Krefting
Message 5 of 8 in “bisect does not respect 'log.date'”
  1. Osipov, Michael (IN IT IN)Mar 13, 2024
  2. Junio C HamanoMar 13, 2024
  3. Osipov, Michael (IN IT IN)Mar 13, 2024
  4. Peter KreftingMar 25, 2024
  5. Junio C HamanoMar 25, 2024
  6. bisect: Honor log.datePeter Krefting, Mar 28, 2024
  7. Eric SunshineMar 28, 2024
  8. Peter KreftingMar 28, 2024

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.