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

[PATCH] Don't use commit-id in building

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Apr 26, 2005, 06:03 UTC
Message-ID
<Pine.LNX.4.21.0504260142130.30848-100000@iabervon.org>
In-Reply-To
<20050426054017.GS13052@parcelfarce.linux.theplanet.co.uk>
On Tue, 26 Apr 2005, Al Viro wrote:
Show 8 quoted lines
> > > So, it still complains about commit-id
> > 
> > In this case, it would complain about .git/HEAD even if it found
> > commit-id. The right solution is probably to suppress that part if there's
> > no .git/HEAD.
> 
> The right thing is to stop assuming that everyone has . in their $PATH,
> to start with...

Does anyone have . in their $PATH? I've only used the commit-id that I installed previously. Since the tarball doesn't have a .git directory, the only way you end up building cogito from a directory with a repository is by using an earlier cogito or something of the sort, in which case, you probably have the program.

In any case, commit-id isn't actually necessary for this operation.

- We don't necessarily have commit-id available when building. Furthermore, we don't necessarily have a repository. Just put in .git/HEAD if it exists; otherwise, it's a base distribution.

Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org>
Index: Makefile
===================================================================
--- f262000f302b749e485f5eb971e6aabefbb85680/Makefile  (mode:100644 sha1:4f01bbbbb3fd0e53e9ce968f167b6dae68fcfa92)
+++ uncommitted/Makefile  (mode:100644)
@@ -87,11 +87,13 @@
 http-pull: LIBS += -lcurl
 
 
-cg-version: $(VERSION)
+cg-version: $(VERSION) .git/HEAD
 	@echo Generating cg-version...
 	@rm -f $@
 	@echo "#!/bin/sh" > $@
-	@PATH=.:$(PATH) echo "echo \"$(shell cat $(VERSION)) ($(shell commit-id))\"" >> $@
+	@echo -n "echo \"$(shell cat $(VERSION))" >> $@
+	@if [ -r .git/HEAD ]; then echo -n " ($(shell cat .git/HEAD))" >> $@; fi
+	@echo "\"" >> $@
 	@chmod +x $@
 
 install: $(PROG) $(SCRIPTS) $(SCRIPT) $(GEN_SCRIPT)
Previous: Al ViroNext: Philip Pokorny
Message 11 of 15 in “[ANNOUNCE] Cogito-0.8 (former git-pasky, big changes!)”
  1. Petr BaudisApr 26, 2005
  2. Petr BaudisApr 26, 2005
  3. Mike TahtApr 26, 2005
  4. Petr BaudisApr 26, 2005
  5. Paul JacksonApr 26, 2005
  6. Martin AtukundaApr 26, 2005
  7. Benjamin HerrenschmidtApr 26, 2005
  8. Jeff GarzikApr 26, 2005
  9. Daniel BarkalowApr 26, 2005
  10. Al ViroApr 26, 2005
  11. Don't use commit-id in buildingDaniel Barkalow, Apr 26, 2005
  12. Philip PokornyApr 26, 2005
  13. Petr BaudisApr 26, 2005
  14. Morten WelinderApr 26, 2005
  15. Pavel MachekApr 26, 2005

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.