{"thread":{"id":"1283","subject":"[PATCH/RFC] Add git-changelog-script to show the changes between two commits","startedAt":"2005-07-21T06:31:43Z","lastAt":"2005-07-21T20:00:51Z","messageCount":3,"participants":["Ryan Anderson","Linus Torvalds"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"6289","messageId":"20050721063143.GO20369@mythryan2.michonline.com","threadId":"1283","inReplyTo":null,"subject":"[PATCH/RFC] Add git-changelog-script to show the changes between two commits","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2005-07-21T06:31:43Z","receivedAt":"2005-07-21T06:31:43Z","isPatch":true,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"I'll start by saying that, well, I'm pretty sure this patch is wrong.\n\nI was trying to look at the changes between two commits, sanely, but\nfailed to find a tool or example in the tree that hinted at how to do\nthis.\n\nAfter poking around at git-whatchanged trying to figure out what it is\ntrying to do - I gave up and wrote something that *seems* to work\ncorrectly for the simple test cases I pulled together.  I just don't\ntrust it.\n\nMy thinking here is that, when doing a release of a package such as git\nor Linux, the releaser could do something like:\n\n\tgit changelog $LAST_RELEASED_COMMIT HEAD | git-shortlog |\\\n\t\tmail -s \"Linux 2.7.0 finally open\" linux-kernel\n\nWhere LAST_RELEASED is recorded somewhere or pulled from an internal\nchangelog with something like:\n\tgrep \"Released commit-id:\" changelog | awk -F: '{print $2}'\" |\\\n\t\thead -1\n\nSigned-off-by: Ryan Anderson <ryan@michonline.com>\n\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -36,7 +36,8 @@ SCRIPTS=git git-apply-patch-script git-m\n \tgit-reset-script git-add-script git-checkout-script git-clone-script \\\n \tgitk git-cherry git-rebase-script git-relink-script git-repack-script \\\n \tgit-format-patch-script git-sh-setup-script git-push-script \\\n-\tgit-branch-script git-parse-remote\n+\tgit-branch-script git-parse-remote \\\n+\tgit-changelog-script git-revdiff-script\n \n PROG=   git-update-cache git-diff-files git-init-db git-write-tree \\\n \tgit-read-tree git-commit-tree git-cat-file git-fsck-cache \\\ndiff --git a/git-changelog-script b/git-changelog-script\nnew file mode 100755\n--- /dev/null\n+++ b/git-changelog-script\n@@ -0,0 +1,3 @@\n+#!/bin/sh\n+\n+git-revdiff-script $@ | git-diff-tree --stdin --pretty -r | LESS=\"$LESS -S\" ${PAGER:-less}\ndiff --git a/git-revdiff-script b/git-revdiff-script\nnew file mode 100755\n--- /dev/null\n+++ b/git-revdiff-script\n@@ -0,0 +1,18 @@\n+#!/usr/bin/perl\n+\n+use warnings;\n+use strict;\n+\n+my ($start,$end) = @ARGV;\n+\n+open(R,\"-|\",\"git-rev-list\",$start)\n+\tor die \"Failed to pipe from git-rev-list: \" . $!;\n+\n+my $rev;\n+while ($rev = <R>) {\n+\tchomp $rev;\n+\tprint $rev,\"\\n\";\n+\tlast if $end eq $rev;\n+}\n+\n+close(R);\n\n\n-- \n\nRyan Anderson\n  sometimes Pug Majere\n"},{"id":"6294","messageId":"20050721194138.GP20369@mythryan2.michonline.com","threadId":"1283","inReplyTo":"20050721063143.GO20369@mythryan2.michonline.com","subject":"Re: [PATCH/RFC] Add git-changelog-script to show the changes between two commits","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2005-07-21T19:41:38Z","receivedAt":"2005-07-21T19:41:38Z","isPatch":true,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"Nevermind, I apparently wanted:\n\tgit-whatchanged HEAD ^$LAST_RELEASED_COMMIT\n\nI'll see about writing up a description of the extended commit reference\nscheme.  Currently I can't find a description of it anywhere in the\nsource tree.\n\nOn Thu, Jul 21, 2005 at 02:31:43AM -0400, Ryan Anderson wrote:\n> I'll start by saying that, well, I'm pretty sure this patch is wrong.\n> \n> I was trying to look at the changes between two commits, sanely, but\n> failed to find a tool or example in the tree that hinted at how to do\n> this.\n> \n> After poking around at git-whatchanged trying to figure out what it is\n> trying to do - I gave up and wrote something that *seems* to work\n> correctly for the simple test cases I pulled together.  I just don't\n> trust it.\n> \n> My thinking here is that, when doing a release of a package such as git\n> or Linux, the releaser could do something like:\n> \n> \tgit changelog $LAST_RELEASED_COMMIT HEAD | git-shortlog |\\\n> \t\tmail -s \"Linux 2.7.0 finally open\" linux-kernel\n> \n> Where LAST_RELEASED is recorded somewhere or pulled from an internal\n> changelog with something like:\n> \tgrep \"Released commit-id:\" changelog | awk -F: '{print $2}'\" |\\\n> \t\thead -1\n> \n> Signed-off-by: Ryan Anderson <ryan@michonline.com>\n> \n> diff --git a/Makefile b/Makefile\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -36,7 +36,8 @@ SCRIPTS=git git-apply-patch-script git-m\n>  \tgit-reset-script git-add-script git-checkout-script git-clone-script \\\n>  \tgitk git-cherry git-rebase-script git-relink-script git-repack-script \\\n>  \tgit-format-patch-script git-sh-setup-script git-push-script \\\n> -\tgit-branch-script git-parse-remote\n> +\tgit-branch-script git-parse-remote \\\n> +\tgit-changelog-script git-revdiff-script\n>  \n>  PROG=   git-update-cache git-diff-files git-init-db git-write-tree \\\n>  \tgit-read-tree git-commit-tree git-cat-file git-fsck-cache \\\n> diff --git a/git-changelog-script b/git-changelog-script\n> new file mode 100755\n> --- /dev/null\n> +++ b/git-changelog-script\n> @@ -0,0 +1,3 @@\n> +#!/bin/sh\n> +\n> +git-revdiff-script $@ | git-diff-tree --stdin --pretty -r | LESS=\"$LESS -S\" ${PAGER:-less}\n> diff --git a/git-revdiff-script b/git-revdiff-script\n> new file mode 100755\n> --- /dev/null\n> +++ b/git-revdiff-script\n> @@ -0,0 +1,18 @@\n> +#!/usr/bin/perl\n> +\n> +use warnings;\n> +use strict;\n> +\n> +my ($start,$end) = @ARGV;\n> +\n> +open(R,\"-|\",\"git-rev-list\",$start)\n> +\tor die \"Failed to pipe from git-rev-list: \" . $!;\n> +\n> +my $rev;\n> +while ($rev = <R>) {\n> +\tchomp $rev;\n> +\tprint $rev,\"\\n\";\n> +\tlast if $end eq $rev;\n> +}\n> +\n> +close(R);\n> \n> \n> -- \n> \n> Ryan Anderson\n>   sometimes Pug Majere\n> -\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n\n-- \n\nRyan Anderson\n  sometimes Pug Majere\n"},{"id":"6295","messageId":"Pine.LNX.4.58.0507211256460.6074@g5.osdl.org","threadId":"1283","inReplyTo":"20050721194138.GP20369@mythryan2.michonline.com","subject":"Re: [PATCH/RFC] Add git-changelog-script to show the changes between two commits","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-07-21T20:00:51Z","receivedAt":"2005-07-21T20:00:51Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 21 Jul 2005, Ryan Anderson wrote:\n>\n> Nevermind, I apparently wanted:\n> \tgit-whatchanged HEAD ^$LAST_RELEASED_COMMIT\n\nYes. And since git-whatchanged uses git-rev-parse, and can thus use the \nextended git commit format, including ranges, you can literally write the \nabove as\n\n\tgit-whatchanged $LAST_RELEASED_COMMIT..\n\n(or, if you only care about the log, not the actual diff lines, use the \nfaster and simpler\n\n\tgit log $LAST_RELEASED_COMMIT..\n\nwhich will also show you merges - something git-whatchanged doesn't do).\n\nYou can also use the \"--pretty\" format specializers, so\n\n\tgit log --pretty=short $LAST_RELEASED_COMMIT..\n\nwill do exactly what you'd expect it to do.\n\n\t\tLinus\n"}]}