{"thread":{"id":"12270","subject":"new GIT-VERSION-GEN with old GIT","startedAt":"2008-02-23T17:34:01Z","lastAt":"2008-02-23T18:46:31Z","messageCount":2,"participants":["Martin Koegler","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"69686","messageId":"20080223173401.GA7808@auto.tuwien.ac.at","threadId":"12270","inReplyTo":null,"subject":"new GIT-VERSION-GEN with old GIT","fromName":"Martin Koegler","fromEmail":"mkoegler@auto.tuwien.ac.at","sentAt":"2008-02-23T17:34:01Z","receivedAt":"2008-02-23T17:34:01Z","isPatch":false,"sender":{"key":"mkoegler@auto.tuwien.ac.at","avatar":null},"body":"On Debian, git 1.4.4 is still shipped in the stable distribution.\n\nSince e5fc9a0aea2c3c49829b5cdf499339e5c759706b, simply running make in\na git checkout yields to an error message.\n\nThe error is in GIT-VERSION-GEN:\n| + git diff-index --quiet HEAD\n| usage: git-diff-index [-m] [--cached] [<common diff options>] <tree-ish> [<path>...]\n| common diff options:\n|   -z            output diff-raw with lines terminated with NUL.\n|   -p            output patch format.\n|   -u            synonym for -p.\n|   --patch-with-raw\n|                 output both a patch and the diff-raw format.\n|   --stat        show diffstat instead of patch.\n|   --numstat     show numeric diffstat instead of patch.\n|   --patch-with-stat\n|                 output a patch and prepend its diffstat.\n|   --name-only   show only names of changed files.\n|   --name-status show names and status of changed files.\n|   --full-index  show full object name on index lines.\n|   --abbrev=<n>  abbreviate object names in diff-tree header and diff-raw.\n|   -R            swap input file pairs.\n|   -B            detect complete rewrites.\n|   -M            detect renames.\n|   -C            detect copies.\n|   --find-copies-harder\n|                 try unchanged files as candidate for copy detection.\n|   -l<n>         limit rename attempts up to <n> paths.\n|   -O<file>      reorder diffs according to the <file>.\n|   -S<string>    find filepair whose only one side contains the string.\n|   --pickaxe-all\n|                 show all files diff when -S is used and hit is found.\n|   -a  --text    treat all files as text.\n\nThe problem is not critical, as the build process continues with wrong\nversion information.\n\nmfg Martin Kögler\n"},{"id":"69694","messageId":"7vtzjz33zs.fsf@gitster.siamese.dyndns.org","threadId":"12270","inReplyTo":"20080223173401.GA7808@auto.tuwien.ac.at","subject":"Re: new GIT-VERSION-GEN with old GIT","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-23T18:46:31Z","receivedAt":"2008-02-23T18:46:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"mkoegler@auto.tuwien.ac.at (Martin Koegler) writes:\n\n> On Debian, git 1.4.4 is still shipped in the stable distribution.\n>\n> Since e5fc9a0aea2c3c49829b5cdf499339e5c759706b, simply running make in\n> a git checkout yields to an error message.\n>\n> The error is in GIT-VERSION-GEN:\n> | + git diff-index --quiet HEAD\n> ...\n\nSorry about that.  I already have forgotten that --quiet was a\nrelatively recent invention.\n\nBefore e5fc9a, we used --name-only, which was around forever.\nThe original diff-cache had it since mid July 2005, and the\ncommand kept the option when it was renamed to diff-index in\nearly September 2005.  That is what we should use.\n\n\n GIT-VERSION-GEN |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN\nindex 03fb9d7..d4714ee 100755\n--- a/GIT-VERSION-GEN\n+++ b/GIT-VERSION-GEN\n@@ -16,7 +16,8 @@ elif test -d .git &&\n \tcase \"$VN\" in\n \t*$LF*) (exit 1) ;;\n \tv[0-9]*)\n-\t\tgit diff-index --quiet HEAD || VN=\"$VN-dirty\" ;;\n+\t\ttest -z \"$(git diff-index --name-only HEAD)\" ||\n+\t\tVN=\"$VN-dirty\" ;;\n \tesac\n then\n \tVN=$(echo \"$VN\" | sed -e 's/-/./g');\n"}]}