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

Re: [PATCH 0/1] Makefile: fix the "built from commit" code

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 28, 2018, 13:18 UTC
Message-ID
<nycvar.QRO.7.76.6.1806281509260.73@tvgsbejvaqbjf.bet>
In-Reply-To
<pull.7.git.gitgitgadget@gmail.com>
Team,
[Cc:ing Tim]
On Thu, 28 Jun 2018, Johannes Schindelin via GitGitGadget wrote:
Show 23 quoted lines
> In ed32b788c06 (version --build-options: report commit, too, if
> possible, 2017-12-15), we introduced code to let `git version
> --build-options` report the current commit from which the binaries were
> built, if any.
> 
> To prevent erroneous commits from being reported (e.g. when unpacking
> Git's source code from a .tar.gz file into a subdirectory of a different
> Git project, as e.g. git_osx_installer does), we painstakingly set
> GIT_CEILING_DIRECTORIES when trying to determine the current commit.
> 
> Except that we got the quoting wrong, and that variable therefore does
> not have the desired effect.
> 
> Let's fix that quoting, and while at it, also suppress the unhelpful
> message
> 
> fatal: not a git repository (or any of the parent directories): .git
> 
> that gets printed to stderr if no current commit could be determined,
> and might scare the occasional developer who simply tries to build Git
> from scratch.
> 
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Sorry for the repeated commit message. I meant to edit the cover letter before sending. It should have read something like this:

-- snip -- Fix "built from commit" logic

When I tried recently to build macOS installers via Tim Harper's wonderful project at https://github.com/timcharper/git_osx_installer, it worked (with a couple of quirks), but it reported to be built from a commit that I first could not place.

Turns out that the git_osx_installer project insists on building Git from a .tar.gz file (even if I have the source code right here, in a perfectly fine worktree). And due to a bug in the logic I introduced, it did not stop looking for a Git repository where it should have stopped. The end effect is that `git version --build-options` reports being built from git_osx_installer's HEAD.

This commit fixes that, and also suppresses the error when no repository could be found. -- snap --

Show 7 quoted lines
> Thanks for taking the time to contribute to Git! Please be advised that the
> Git community does not use github.com for their contributions. Instead, we use
> a mailing list (git@vger.kernel.org) for code submissions, code reviews, and
> bug reports. Nevertheless, you can use submitGit to conveniently send your Pull
> Requests commits to our mailing list.
> 
> Please read the "guidelines for contributing" linked above!
Again, sorry for failing to edit this before sending.
Show 10 quoted lines
> 
> Johannes Schindelin (1):
>   Makefile: fix the "built from commit" code
> 
>  Makefile | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> 
> base-commit: ed843436dd4924c10669820cc73daf50f0b4dabd
> Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-7/dscho/fix-build-options-commit-info-v1

This should be https://github.com/gitgitgadget/git/releases/tag/pr-7%2Fdscho%2Ffix-build-options-commit-info-v1 instead. Again: sorry!

> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-7/dscho/fix-build-options-commit-info-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/7
These are correct.

Ciao, Dscho

> -- 
> gitgitgadget
> 
Previous: Jeff KingNext: brian m. carlson
Message 9 of 12 in “Makefile: fix the "built from commit" code”
  1. 0/1 Makefile: fix the "built from commit" codeJohannes Schindelin via GitGitGadget, Jun 28, 2018
  2. 1/1 Makefile: fix the "built from commit" codeJohannes Schindelin via GitGitGadget, Jun 27, 2018
  3. Jeff KingJun 28, 2018
  4. Johannes SchindelinJun 28, 2018
  5. Junio C HamanoJun 28, 2018
  6. Jeff KingJun 28, 2018
  7. Johannes SchindelinJun 29, 2018
  8. Jeff KingJun 28, 2018
  9. Johannes SchindelinJun 28, 2018
  10. brian m. carlsonJun 28, 2018
  11. 0/1 Fix "built from commit" logicJohannes Schindelin via GitGitGadget, Jun 29, 2018
  12. 1/1 Makefile: fix the "built from commit" codeJohannes Schindelin via GitGitGadget, Jun 27, 2018

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.