{"thread":{"id":"330","subject":"[PATCH] Cogito chicken-and-egg problem","startedAt":"2005-04-26T16:06:10Z","lastAt":"2005-04-26T17:48:32Z","messageCount":4,"participants":["Pavel Roskin","Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"1744","messageId":"1114531570.19478.6.camel@dv","threadId":"330","inReplyTo":null,"subject":"[PATCH] Cogito chicken-and-egg problem","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-04-26T16:06:10Z","receivedAt":"2005-04-26T16:06:10Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\nMy patch for Makefile was misapplied, so installed commit-id is still\nneeded for \"make\" to succeed.\n\nShell commands are processed by make before being passed to the shell,\nand $(...) is expanded by make before new PATH is set, as it is done in\nthe current Makefile.\n\nAlso, the dependency on commit-id was dropped from my patch for some\nreason.  I believe it's still needed.  Also, we need a dependency on\ncat-file, which is used by commit-id internally.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\nIndex: Makefile\n===================================================================\n--- f262000f302b749e485f5eb971e6aabefbb85680/Makefile  (mode:100644 sha1:4f01bbbbb3fd0e53e9ce968f167b6dae68fcfa92)\n+++ uncommitted/Makefile  (mode:100644)\n@@ -87,11 +87,11 @@\n http-pull: LIBS += -lcurl\n \n \n-cg-version: $(VERSION)\n+cg-version: $(VERSION) commit-id cat-file\n \t@echo Generating cg-version...\n \t@rm -f $@\n \t@echo \"#!/bin/sh\" > $@\n-\t@PATH=.:$(PATH) echo \"echo \\\"$(shell cat $(VERSION)) ($(shell commit-id))\\\"\" >> $@\n+\t@echo \"echo \\\"$(shell cat $(VERSION)) ($(shell PATH=.:$(PATH) ./commit-id))\\\"\" >> $@\n \t@chmod +x $@\n \n install: $(PROG) $(SCRIPTS) $(SCRIPT) $(GEN_SCRIPT)\n\n\n-- \nRegards,\nPavel Roskin\n\n"},{"id":"1749","messageId":"Pine.LNX.4.21.0504261229220.30848-100000@iabervon.org","threadId":"330","inReplyTo":"1114531570.19478.6.camel@dv","subject":"Re: [PATCH] Cogito chicken-and-egg problem","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-04-26T16:38:38Z","receivedAt":"2005-04-26T16:38:38Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 26 Apr 2005, Pavel Roskin wrote:\n\n> Hello!\n> \n> My patch for Makefile was misapplied, so installed commit-id is still\n> needed for \"make\" to succeed.\n> \n> Shell commands are processed by make before being passed to the shell,\n> and $(...) is expanded by make before new PATH is set, as it is done in\n> the current Makefile.\n> \n> Also, the dependency on commit-id was dropped from my patch for some\n> reason.  I believe it's still needed.  Also, we need a dependency on\n> cat-file, which is used by commit-id internally.\n\ncommit-id doesn't really use cat-file; the way it calls gitXnormid.sh\ndefinitely suppresses that section. In fact, commit-id with no arguments\nis simply an easy-to-remember way of doing \"cat .git/HEAD\" using a much\nmore complicated script. Earlier, I sent a patch to just do this, since it\navoids the whole issue.\n\n(Also, .git/HEAD is a dependancy, since you want to redo the version\nscript if you commit; but if you don't have it, that's okay and just means\nyou're building from a tarball, which is described completely by VERSION)\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"},{"id":"1752","messageId":"1114534942.26856.10.camel@dv","threadId":"330","inReplyTo":"Pine.LNX.4.21.0504261229220.30848-100000@iabervon.org","subject":"Re: [PATCH] Cogito chicken-and-egg problem","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-04-26T17:02:22Z","receivedAt":"2005-04-26T17:02:22Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello, Daniel!\n\nOn Tue, 2005-04-26 at 12:38 -0400, Daniel Barkalow wrote:\n\n> > Also, the dependency on commit-id was dropped from my patch for some\n> > reason.  I believe it's still needed.  Also, we need a dependency on\n> > cat-file, which is used by commit-id internally.\n> \n> commit-id doesn't really use cat-file; the way it calls gitXnormid.sh\n\nThere is gitXnormid.sh in the current cogito.  Please update your tree.\n\n> definitely suppresses that section.\n\nThat's not what I see if I remove cat-file but leave commit-id in my\n$HOME/bin:\n\nproski@dv:~/src/cogito$ make cg-version\n/home/proski/bin/commit-id: line 35: cat-file: command not found\nInvalid id: f9f0459b5b39cf83143c91ae39b4eaf187cf678a\nGenerating cg-version...\nproski@dv:~/src/cogito$\n\n> In fact, commit-id with no arguments\n> is simply an easy-to-remember way of doing \"cat .git/HEAD\" using a much\n> more complicated script. Earlier, I sent a patch to just do this, since it\n> avoids the whole issue.\n\nThat would be fine with me.\n\n> (Also, .git/HEAD is a dependancy, since you want to redo the version\n> script if you commit; but if you don't have it, that's okay and just means\n> you're building from a tarball, which is described completely by VERSION)\n\nIt should be a conditional dependency, i.e. it should be a dependency\nif .git exists.\n\nIt seems to me that the whole idea of including SHA1 in cg-version is\nbroken.  SHA1 is not human readable.  But if the maintainers insist on\nhaving SHA1 in cg-version, I want it to be done without causing build\nwarnings for new users.\n\nHere's an alternative patch.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\nIndex: Makefile\n===================================================================\n--- f262000f302b749e485f5eb971e6aabefbb85680/Makefile  (mode:100644 sha1:4f01bbbbb3fd0e53e9ce968f167b6dae68fcfa92)\n+++ uncommitted/Makefile  (mode:100644)\n@@ -87,12 +87,21 @@\n http-pull: LIBS += -lcurl\n \n \n+ifneq (,$(wildcard .git))\n+cg-version: $(VERSION) .git/HEAD\n+\t@echo Generating cg-version...\n+\t@rm -f $@\n+\t@echo \"#!/bin/sh\" > $@\n+\t@echo \"echo \\\"$(shell cat $(VERSION)) ($(shell cat .git/HEAD))\\\"\" >> $@\n+\t@chmod +x $@\n+else\n cg-version: $(VERSION)\n \t@echo Generating cg-version...\n \t@rm -f $@\n \t@echo \"#!/bin/sh\" > $@\n-\t@PATH=.:$(PATH) echo \"echo \\\"$(shell cat $(VERSION)) ($(shell commit-id))\\\"\" >> $@\n+\t@echo \"echo \\\"$(shell cat $(VERSION))\\\"\" >> $@\n \t@chmod +x $@\n+endif\n \n install: $(PROG) $(SCRIPTS) $(SCRIPT) $(GEN_SCRIPT)\n \tinstall -m755 -d $(DESTDIR)$(bindir)\n\n\n-- \nRegards,\nPavel Roskin\n\n"},{"id":"1758","messageId":"Pine.LNX.4.21.0504261322490.30848-100000@iabervon.org","threadId":"330","inReplyTo":"1114534942.26856.10.camel@dv","subject":"Re: [PATCH] Cogito chicken-and-egg problem","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-04-26T17:48:32Z","receivedAt":"2005-04-26T17:48:32Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 26 Apr 2005, Pavel Roskin wrote:\n\n> > (Also, .git/HEAD is a dependancy, since you want to redo the version\n> > script if you commit; but if you don't have it, that's okay and just means\n> > you're building from a tarball, which is described completely by VERSION)\n> \n> It should be a conditional dependency, i.e. it should be a dependency\n> if .git exists.\n\nTrue.\n\n> It seems to me that the whole idea of including SHA1 in cg-version is\n> broken.  SHA1 is not human readable.  But if the maintainers insist on\n> having SHA1 in cg-version, I want it to be done without causing build\n> warnings for new users.\n\nThe idea is that it should appear if you're building a version that has\nchanges in its .git; in this case, VERSION is insufficient to tell you\nwhich revision you have installed. If I've got cogito-0.8 + three untagged\ncommits from the remote repository + two local patches, I'd like to be\nable to tell if the installed version is cogito-0.8 + two of the remote\npatches. Possibly, it should also suppress the SHA1 if you've got a tagged\nhead, but identifying this situation is tricky, currently. Eventually, it\nshould be able to use a cg program to update VERSION from .git/HEAD and\ninclude SHA1 for cases which aren't directly tagged.\n\n> Here's an alternative patch.\n\nI like your version.\n\n\t-Daniel\n*This .sig left intentionally blank*\n\n"}]}