{"thread":{"id":"11453","subject":"Retroactively change email signature?","startedAt":"2008-01-02T20:37:51Z","lastAt":"2008-01-04T23:08:43Z","messageCount":9,"participants":["Stephen Sinclair","Jakub Narebski","Linus Torvalds","David Brown","Sam Vilain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"64350","messageId":"9b3e2dc20801021237v4d5d236fn3d2643502b9bb78f@mail.gmail.com","threadId":"11453","inReplyTo":null,"subject":"Retroactively change email signature?","fromName":"Stephen Sinclair","fromEmail":"radarsat1@gmail.com","sentAt":"2008-01-02T20:37:51Z","receivedAt":"2008-01-02T20:37:51Z","isPatch":false,"sender":{"key":"radarsat1@gmail.com","avatar":null},"body":"Hi,\n\nI imagine that changing old commits is considered one of the great\nevils of source control, but I have a small problem:\nI have a habit of testing my code on several different computers and\noperating systems.  Sometimes when setting up a new computer for\ntesting (and thus, for development, since testing always results in a\nfew commits), I have forgotten to use git-config to configure my name\nand email address.\n\nSince git doesn't warn when I've forgotten to do this, my git-log is\nnow sprinkled with various email addresses, some which are just my\nusername@hostname.  This is completely useless to people who might\nview my public repository.\n\nIs it possible to retroactively change the author and email of several\ncommits?  Perhaps some sort of search-and-replace for the commit\nmetadata?  Even for older commits, I'd like to change the email\naddresses to my current address.\n\nIf it's not possible it's not the end of the world, but I thought it\nwouldn't hurt to ask.\n\nthanks,\nSteve\n"},{"id":"64351","messageId":"m3ejczordw.fsf@roke.D-201","threadId":"11453","inReplyTo":"9b3e2dc20801021237v4d5d236fn3d2643502b9bb78f@mail.gmail.com","subject":"Re: Retroactively change email signature?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-01-02T21:17:00Z","receivedAt":"2008-01-02T21:17:00Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Stephen Sinclair\" <radarsat1@gmail.com> writes:\n\n> I imagine that changing old commits is considered one of the great\n> evils of source control, but I have a small problem:\n> I have a habit of testing my code on several different computers and\n> operating systems.  Sometimes when setting up a new computer for\n> testing (and thus, for development, since testing always results in a\n> few commits), I have forgotten to use git-config to configure my name\n> and email address.\n> \n> Since git doesn't warn when I've forgotten to do this, my git-log is\n> now sprinkled with various email addresses, some which are just my\n> username@hostname.  This is completely useless to people who might\n> view my public repository.\n\nThis most certainly should get addressed IMHO.\n \n> Is it possible to retroactively change the author and email of several\n> commits?  Perhaps some sort of search-and-replace for the commit\n> metadata?  Even for older commits, I'd like to change the email\n> addresses to my current address.\n> \n> If it's not possible it's not the end of the world, but I thought it\n> wouldn't hurt to ask.\n\nYou can use git-filter-branch(1), but please remember that it is\npractically rewriting whole repository, so you should do this _before_\nyou publish any changes.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"64352","messageId":"alpine.LFD.1.00.0801021316080.3010@woody.linux-foundation.org","threadId":"11453","inReplyTo":"9b3e2dc20801021237v4d5d236fn3d2643502b9bb78f@mail.gmail.com","subject":"Re: Retroactively change email signature?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-01-02T21:24:49Z","receivedAt":"2008-01-02T21:24:49Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 2 Jan 2008, Stephen Sinclair wrote:\n> \n> Is it possible to retroactively change the author and email of several\n> commits?  Perhaps some sort of search-and-replace for the commit\n> metadata?  Even for older commits, I'd like to change the email\n> addresses to my current address.\n\nSee\n\n\tman git-filter-branch\n\nand the \"--env-filter\" flag (and \"--msg-filter\" if you also want to change \nthings like Sign-off's etc in the message text itself)\n\nBUT! See also the big bold-face warning: using \"filter-branch\" will not \nchange old commits, it will create a series of *new* commits that bear a \nstriking resemblance to the old ones, but are not the same. So you'll have \na totally new history.\n\nThat matters for things like\n - if you've already publicised the old history, you need to tell people \n   that they should fetch things anew\n - if you refer to the commit SHA1's elsewhere (like in commit messages \n   that revert previous commits), those SHA1's are still \"valid\", but they \n   refer to the *old* history, not the new history you created.\n\n(I don't think git-filter-branch even exposes any easy way to remap the \n\"revert commit xyz\" messages in the message format. It's not technically \nhard to use a --msg-filter for it, but it seems a big bother).\n\n\t\tLinus\n"},{"id":"64355","messageId":"9b3e2dc20801021406h46a73ef3ye0c4613d6472a4b3@mail.gmail.com","threadId":"11453","inReplyTo":"alpine.LFD.1.00.0801021316080.3010@woody.linux-foundation.org","subject":"Re: Retroactively change email signature?","fromName":"Stephen Sinclair","fromEmail":"radarsat1@gmail.com","sentAt":"2008-01-02T22:06:37Z","receivedAt":"2008-01-02T22:06:37Z","isPatch":false,"sender":{"key":"radarsat1@gmail.com","avatar":null},"body":"Thanks, I was able to use git-filter-branch to accomplish what I wanted.\nI should have mentioned in the original email that it is not a widely\ndistributed repo, so I'm not too worried about breaking things at this\npoint.  I guess for a larger project it might be a problem, so I\nprobably just wouldn't do it.\n\n> BUT! See also the big bold-face warning: using \"filter-branch\" will not\n> change old commits, it will create a series of *new* commits that bear a\n> striking resemblance to the old ones, but are not the same. So you'll have\n> a totally new history.\n\nGot it, thanks.\nI'll just have to remember to git-config properly next time I do this.\n\nOne thing that's a bit odd for me is that I use a different email\naddress for this particular project..\nConveniently I'm able to use git-config to set an email address\nlocally for this repo, however I have to remember to do this every\ntime I clone it somewhere.  Not a problem, necessarily, but perhaps\njust a matter of training myself.\n\nFor example, I have a clone of this repo on a Linux, Windows, and OS X\nmachine, and also another clone for each on my laptop..  git is\nactually turning out to be great for doing all this swapping between\nmachines, but it does take a little training to remember to set the\nconfiguration, since there's no central repo to ask me for my username\nand password before I can commit.\n\n\ncheers,\nSteve\n"},{"id":"64364","messageId":"20080103005309.GA6158@old.davidb.org","threadId":"11453","inReplyTo":"9b3e2dc20801021406h46a73ef3ye0c4613d6472a4b3@mail.gmail.com","subject":"Re: Retroactively change email signature?","fromName":"David Brown","fromEmail":"git@davidb.org","sentAt":"2008-01-03T00:53:09Z","receivedAt":"2008-01-03T00:53:09Z","isPatch":false,"sender":{"key":"git@davidb.org","avatar":"https://gravatar.com/avatar/94c86a2938470a74c2eac5e2b69afc0871f79a660295c02219597aba8cb101c1?d=mp&s=160"},"body":"On Wed, Jan 02, 2008 at 05:06:37PM -0500, Stephen Sinclair wrote:\n\n>For example, I have a clone of this repo on a Linux, Windows, and OS X\n>machine, and also another clone for each on my laptop..  git is\n>actually turning out to be great for doing all this swapping between\n>machines, but it does take a little training to remember to set the\n>configuration, since there's no central repo to ask me for my username\n>and password before I can commit.\n\nYou can set the user.email and user.name globally with 'git config --global\nuser.email ...' and the likes, but that only works if you use the same ID.\n\nIt'd be nice if there was something that could be put in the global\nuser.email to require each repository to override that.  On one machine, my\npassword file doesn't have my name in it, and I kind of get this behavior\nby default, but it be nice to be able to do it for real.\n\nAnyone have ideas on how this could be done?\n\nDave\n"},{"id":"64436","messageId":"477C7837.9000303@vilain.net","threadId":"11453","inReplyTo":"alpine.LFD.1.00.0801021316080.3010@woody.linux-foundation.org","subject":"Re: Retroactively change email signature? [resend]","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-01-03T05:52:55Z","receivedAt":"2008-01-03T05:52:55Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Linus Torvalds wrote:\n> (I don't think git-filter-branch even exposes any easy way to remap the \n> \"revert commit xyz\" messages in the message format. It's not technically \n> hard to use a --msg-filter for it, but it seems a big bother).\n\nAssuming, of course, that the commit you refer to in a message like that\nis in your history.  If it's referring to another commit in a different\nbranch, which may be being re-written, you've got two problems:\n\n1. rewriting the commit\n\n2. making sure that git-filter-branch processes the two commits in the\nright order.\n\nThe first is easily fixable; the second requires a hook in\ngit-filter-branch to customize the tournament.\n\nSubject: [PATCH] git-filter-branch: allow a custom tournament for rewrite ordering\n\nThe topological sort by git rev-list may be inconvenient for history\nmodification where commit IDs are used in comments to refer to other\nchanges.  So, allow for a program that can take a list of commits, and\nreturn that list in the order that the rewriter must follow.  Borrow\n\"Tournament\" term from Graph Theory.\n\nSigned-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>\n---\n Documentation/git-filter-branch.txt         |   18 ++++\n contrib/filter-branch/msg-links.perl        |   50 +++++++++\n contrib/filter-branch/tournament-links.perl |  148 +++++++++++++++++++++++++++\n git-filter-branch.sh                        |   11 ++\n t/t7003-filter-branch.sh                    |   21 ++++\n 5 files changed, 248 insertions(+), 0 deletions(-)\n create mode 100755 contrib/filter-branch/msg-links.perl\n create mode 100755 contrib/filter-branch/tournament-links.perl\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex 895d750..ed3a839 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -118,6 +118,24 @@ convenience functions, too.  For example, calling 'skip_commit \"$@\"'\n will leave out the current commit (but not its changes! If you want\n that, use gitlink:git-rebase[1] instead).\n \n+--tournament <command>::\n+\tThis command is responsible for re-ordering the commit history\n+\tafter it is retrieved from the input list.  It is passed on\n+\tstandard input the deduced list based upon a regular\n+\ttopological search, and the command is expected to print to\n+\tstandard output a list in the same form.\n++\n+Again, this can't be used to re-order patches like\n+gitlink:git-rebase[1] does, as the tree IDs of the original positions\n+will remain untouched, so the differences between revisions will be\n+scrambled.\n++\n+However, it is required when you need to refer to a commit by ID in a\n+commit message, where the commit you are referring to is on an\n+unrelated branch.  See the contributed filters in the Git distribution\n+for an example script that can let you preserve such referential\n+integrity during a rewrite.\n+\n --tag-name-filter <command>::\n \tThis is the filter for rewriting tag names. When passed,\n \tit will be called for every tag ref that points to a rewritten\ndiff --git a/contrib/filter-branch/msg-links.perl b/contrib/filter-branch/msg-links.perl\nnew file mode 100755\nindex 0000000..1ff780c\n--- /dev/null\n+++ b/contrib/filter-branch/msg-links.perl\n@@ -0,0 +1,50 @@\n+#!/usr/bin/perl -nl\n+#\n+#   msg-links.perl\n+#\n+# This is the companion script to tournament-links.perl, it is\n+# configured in the same way.  If you want this script, you will\n+# probably also want the other one.\n+#\n+# What it does is rewrites all commit IDs of at least 12 digits long\n+# to the post-rewritten version.  Note that this works only for\n+# commits seen by the current git-filter-branch run!  If you need to\n+# correct \"dead\" links from a previous run, then supply the rewrite\n+# file.\n+#\n+# You don't need the tournament filter if all of the commits IDs you\n+# are changing to are \"ancient\" history, or if you are rewriting\n+# history that is a straight line.\n+\n+no strict;\n+no warnings;\n+\n+use constant REV_MIN_LENGTH => $ENV{MSG_LINK_MIN} || 12;\n+\n+BEGIN {\n+\t$mlr = \"$ENV{GITDIR}/msg-link-rewrite\";\n+\tif ( -e $mlr ) {\n+\t\topen FH, \"<\", $mlr or die $!;\n+\t\tlocal($/);\n+\t\t%remap = m{([0-9a-f]{40})}g while <FH>;\n+\t}\n+\t( -d \"../map\" ) or die \"can't see the git-filter-branch map dir\";\n+}\n+\n+my $old = $_;\n+s{([0-9a-f]{${\\(REV_MIN_LENGTH)},40})}{substr(($remap{$1}?do {\n+\tprint STDERR \" Remapped: $1 => $remap{$1} (rule)\\n\";\n+\t$remap{$1}; }\n+\t\t   : $1), 0, length($1))}eg;\n+\n+s{([0-9a-f]{${\\(REV_MIN_LENGTH)},40})}{substr((-e \"../map/$1\" ? do {\n+\t$x = `cat ../map/$1`; chomp($x);\n+\t\tprint STDERR \" Remapped: $1 => $x (ripple)\\n\";\n+\t$x}\n+: $1),0,length($1))}eg;\n+\n+if ( $old ne $_ ) {\n+\tprint STDERR \"*** filtered: pre: \\n$old\\n post:\\n$_\\n\";\n+}\n+\n+print;\ndiff --git a/contrib/filter-branch/tournament-links.perl b/contrib/filter-branch/tournament-links.perl\nnew file mode 100755\nindex 0000000..479a28f\n--- /dev/null\n+++ b/contrib/filter-branch/tournament-links.perl\n@@ -0,0 +1,148 @@\n+#!/usr/bin/perl\n+#\n+#  tournament-links.perl: a tournament that allows simple re-ordering.\n+#\n+#  This provides the requirement of getting the commits in the right\n+#  order if there are any (full length) commitids in the commit\n+#  messages.  It also provides for some remapping along the way (if,\n+#  say, a referenced commit ID was wrong).  To do that, put it in a\n+#  file in GIT_DIR called \"msg-link-rewrite\".\n+#\n+#  The format of msg-link-rewrite is very simple - any full-length\n+#  SHA1s that are seen in the file are put into a single hash.  So,\n+#  every other item is a key, starting with the first.  Everything\n+#  else in the file is ignored.  This is combined with the remapping\n+#  that the current git-filter-branch run has performed.\n+#\n+#  This script is only called once, at the beginning of the run, and\n+#  can be relatively expensive on this basis.  This one is practically\n+#  guaranteed to feed quicksort it's worst nightmare every time.\n+#\n+#  Example:\n+#    $ cat > .git/msg-link-rewrite <<EOF\n+#        Rewrite the commit ID 123456789012 to\n+#              '92712632981923'\n+#    EOF\n+#    $ path=$ENV{HOME}/src/git/contrib/filter-branch\n+#    $ git-filter-branch --tournament $path/tournament.perl \\\n+#         --msg-filter $path/msg-links.perl\n+#\n+\n+no strict;\n+no warnings;\n+# use sort '_mergesort'; # Perl 5.10+ - use a mergesort instead\n+\n+use constant WATCH_BATTLE => $ENV{WATCH_BATTLE};\n+use constant TOURNAMENT_RESULTS => $ENV{TOURNAMENT_RESULTS};\n+use constant REV_MIN_LENGTH => $ENV{MSG_LINK_MIN} || 12;\n+\n+BEGIN {\n+\t$mlr = \"$ENV{GITDIR}/msg-link-rewrite\";\n+\tif ( -e $mlr ) {\n+\t\topen FH, \"<\", $mlr or die $!;\n+\t\tlocal($/);\n+\t\t%remap = m{([0-9a-f]{${\\(REV_MIN_LENGTH)},40})}g while <FH>;\n+\t}\n+\t( -d \"../map\" ) or die \"can't see the git-filter-branch map dir\";\n+}\n+\n+@commits = <>;\n+%refers;\n+\n+# shorten a commit ID to something human-readable for display to\n+# STDERR only\n+sub n{\n+\tmy $commitid = shift;\n+\tsubstr($commitid, 0, 12);\n+}\n+\n+print STDERR \"tournament: read \".@commits.\" commit IDs\\n\"\n+\tif TOURNAMENT_RESULTS;\n+\n+for my $line ( @commits ) {\n+\tchomp($line);\n+\tmy ($commit, @parents) = split \" \", $line;\n+\tmy @refers_commitids;\n+\topen COMMIT, \"-|\", qw(git cat-file commit), $commit;\n+\twhile ( <COMMIT> ) {\n+\t\tpush @refers_commitids, $1 if m{^parent (.*)$};\n+\t\tlast if m{^\\s*$};\n+\t}\n+\n+\tmy $msg = join \"\", <COMMIT>;\n+\n+\tmy @refers_commitids = map {\n+\t\tmy ($match) = $remap{$_} ? ($remap{$_})\n+\t\t\t: map { $remap{$_} } grep m{^$_}, keys %remap;\n+\t\tif ( $match ) {\n+\t\t\tprint STDERR \"msg-link in \".n($commit).\": \"\n+\t\t\t\t.n($_).\" treated as \".n($match).\"\\n\"\n+\t\t\t\t\tif WATCH_BATTLE;\n+\t\t\t$match;\n+\t\t}\n+\t\telsif ( do { $match = `git rev-parse $_`; !$? } ) {\n+\t\t\tchomp($match);\n+\t\t\tprint STDERR \"msg-link seen in \".n($commit)\n+\t\t\t\t.\" to \".n($match).\"\\n\"\n+\t\t\t\t\tif WATCH_BATTLE;\n+\t\t\t$match;\n+\t\t}\n+\t\telse {\n+\t\t\tprint STDERR \"dead msg-link seen in \".n($commit)\n+\t\t\t\t.\" to \".n($_).\"\\n\";\n+\t\t\t$_;\n+\t\t}\n+\t} ($msg =~ m{([0-9a-f]{${\\(REV_MIN_LENGTH)},40})}g);\n+\n+\twarn(\"$commit is not an extant revision\\n\"), next if $?;\n+\n+\t$refers{$commit} = { map { $_ => 1 } @refers_commitids, @parents };\n+}\n+print STDERR \"tournament: read \".@commits.\" commits\\n\"\n+\tif TOURNAMENT_RESULTS;\n+\n+my $O;\n+\n+# returns 1 if source refers to target, or target is a parent of\n+# anything referred to by source.\n+my $refers = sub {\n+\tmy $source = shift;\n+\tmy $target = shift;\n+\tmy @todo = keys %{ $refers{$source}||{} };\n+\tmy %seen = map { $_ => 1 } @todo;\n+\twhile ( my $commit = shift @todo ) {\n+\t\t$O++;\n+\t\tdo {\n+\t\t\tprint STDERR n($source).\" refers to \".n($target).\"\\n\"\n+\t\t\t\tif WATCH_BATTLE;\n+\t\t\treturn 1;\n+\t\t} if $commit eq $target;\n+\t\tpush @todo, grep { $O++; !$seen{$_}++ }\n+\t\t\tkeys %{ $refers{$commit} || {} };\n+\t}\n+\tprint STDERR n($source).\" does not refer to \".n($target).\"\\n\"\n+\t\tif WATCH_BATTLE;\n+\treturn 0;\n+};\n+\n+# It's tournament time!\n+print \"$_\\n\" for sort {\n+\t(my $_a = $a) =~ s{ .*}{};\n+\t(my $_b = $b) =~ s{ .*}{};\n+\tmy $cmp_val = 0;\n+\tif ( $refers->($_a, $_b) ) {\n+\t\t++$cmp_val;\n+\t}\n+\telsif ( $refers->($_b, $_a) ) {\n+\t\t--$cmp_val;\n+\t}\n+\tprint STDERR n($a).\" \".\n+\t\t(($cmp_val == 0 ? \"EQUIVALENT TO\" :\n+\t\t  $cmp_val == -1 ? \"COMES BEFORE\" :\n+\t\t  $cmp_val == 1 ? \"COMES AFTER\" : \"TSNH\")\n+\t\t .\" \".n($b).\"\\n\")\n+\t\t\tif WATCH_BATTLE;\n+\t$cmp_val;\n+} @commits;\n+\n+print STDERR \"tournament-links.perl: O(\".@commits.\") = \".$O.\"\\n\";\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex ae29f47..6c099ea 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -110,6 +110,7 @@ filter_msg=cat\n filter_commit='git commit-tree \"$@\"'\n filter_tag_name=\n filter_subdir=\n+tournament=\n orig_namespace=refs/original/\n force=\n while :\n@@ -166,6 +167,9 @@ do\n \t--subdirectory-filter)\n \t\tfilter_subdir=\"$OPTARG\"\n \t\t;;\n+\t--tournament)\n+\t\ttournament=\"$OPTARG\"\n+\t\t;;\n \t--original)\n \t\torig_namespace=$(expr \"$OPTARG/\" : '\\(.*[^/]\\)/*$')/\n \t\t;;\n@@ -254,6 +258,13 @@ commits=$(wc -l <../revs | tr -d \" \")\n \n test $commits -eq 0 && die \"Found nothing to rewrite\"\n \n+if [ -n \"$tournament\" ]\n+then\n+\tcat ../revs | (eval \"$tournament\") > ../revs.sorted\n+\tmv ../revs ../revs.pre-sorted\n+\tmv ../revs.sorted ../revs\n+fi\n+\n # Rewrite the commits\n \n i=0\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 5f60b22..8d5679d 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -165,4 +165,25 @@ test_expect_success '\"map\" works in commit filter' '\n \tgit rev-parse --verify master\n '\n \n+test_expect_success \"Specifying a custom tournament\" '\n+        git checkout -b custom-tournament &&\n+\techo \"Hello\">&2\n+        echo j > j &&\n+\tgit add j &&\n+\techo \"There\">&2\n+        git commit -m j j &&\n+        echo z > z &&\n+\tgit add z &&\n+\techo \"Dude\">&2\n+        git commit -m z &&\n+        echo x > x &&\n+\tgit add x &&\n+\techo \"Dude\">&2\n+        git commit -m x &&\n+        git-filter-branch -f --parent-filter cat --tournament \"cat > foo; fp=\\$(head -1 foo | awk \\\"{print \\\\\\$2}\\\"); ( head -2 foo | tac; tail -1 foo ) | awk \\\"{print \\\\\\$1}\\\" | while read x y; do echo \\$x \\$fp; fp=\\$x; done\"  master..HEAD &&\n+\torder=$(git-log --pretty=format:\"%s\" master...custom-tournament | xargs) &&\n+\techo \"order is <$order>\" &&\n+\ttest \"$order\" = \"x j z\"\n+'\n+\n test_done\n-- \n1.5.3.5\n"},{"id":"64452","messageId":"alpine.LFD.1.00.0801041031590.2811@woody.linux-foundation.org","threadId":"11453","inReplyTo":"477C7837.9000303@vilain.net","subject":"Re: Retroactively change email signature? [resend]","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-01-04T18:34:39Z","receivedAt":"2008-01-04T18:34:39Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 3 Jan 2008, Sam Vilain wrote:\n> \n> Assuming, of course, that the commit you refer to in a message like that\n> is in your history.  If it's referring to another commit in a different\n> branch, which may be being re-written, you've got two problems:\n\nI don't care. If some commit refers to another commit that isn't its \nancestor, then that is undefined *anyway*. \n\nSo the only case that really matters is when you refer to your own strict \nancestor.\n\nThis is one reason why it was so crazy that \"git cherry-pick\" used to have \n\"-x\" by default - appending the original SHA1 (which is generally *not* an \nancestor) is meaningless and stupid.\n\nBut in the case of \"git revert\", it should be an ancestor (or the _user_ \nis just insane, in which case it doesn't matter - insane people can do \ninsane things)\n\n\t\tLinus\n"},{"id":"64472","messageId":"477EBB92.605@vilain.net","threadId":"11453","inReplyTo":"alpine.LFD.1.00.0801041031590.2811@woody.linux-foundation.org","subject":"Re: Retroactively change email signature? [resend]","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-01-04T23:04:50Z","receivedAt":"2008-01-04T23:04:50Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Linus Torvalds wrote:\n> I don't care. If some commit refers to another commit that isn't its \n> ancestor, then that is undefined *anyway*. \n> \n> So the only case that really matters is when you refer to your own strict \n> ancestor.\n> \n> This is one reason why it was so crazy that \"git cherry-pick\" used to have \n> \"-x\" by default - appending the original SHA1 (which is generally *not* an \n> ancestor) is meaningless and stupid.\n\nNot stupid at all.  It gives you an easily clickable link to the\nprevious version of the patch, which may be of interest, and is\notherwise irretrievable information if the patch needed resolving.\n\nSam.\n"},{"id":"64473","messageId":"477EBC7B.2080606@vilain.net","threadId":"11453","inReplyTo":"477EBB92.605@vilain.net","subject":"Re: Retroactively change email signature? [resend]","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-01-04T23:08:43Z","receivedAt":"2008-01-04T23:08:43Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Sam Vilain wrote:\n> Linus Torvalds wrote:\n>> I don't care. If some commit refers to another commit that isn't its \n>> ancestor, then that is undefined *anyway*. \n>>\n>> So the only case that really matters is when you refer to your own strict \n>> ancestor.\n>>\n>> This is one reason why it was so crazy that \"git cherry-pick\" used to have \n>> \"-x\" by default - appending the original SHA1 (which is generally *not* an \n>> ancestor) is meaningless and stupid.\n> \n> Not stupid at all.  It gives you an easily clickable link to the\n> previous version of the patch, which may be of interest, and is\n> otherwise irretrievable information if the patch needed resolving.\n\nfootnote: of course it is entirely meaningless if the referred SHA1 is\nnot published anywhere, so I agree with the cherry-pick default setting.\n\nSam.\n"}]}