{"thread":{"id":"6775","subject":"[PATCH] Use patch file's modtime as the git author and commiter date","startedAt":"2007-02-11T23:24:35Z","lastAt":"2007-02-12T06:57:20Z","messageCount":2,"participants":["Theodore Ts'o","Josef Sipek"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"34224","messageId":"11712362751442-git-send-email-tytso@mit.edu","threadId":"6775","inReplyTo":null,"subject":"[PATCH] Use patch file's modtime as the git author and commiter date","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-02-11T23:24:35Z","receivedAt":"2007-02-11T23:24:35Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"By using the same author and committer date, it keeps the git commit\nid's stable if the patches haven't changed.  Otherwise, repeated\ninvocations of \"guilt pop -a; guilt push -a\" will create new commit's\nwith different commit dates, creating a lot of garbage commits that\nwon't disappear for a LONG time, even after running \"git-gc --prune\",\nthanks to the reflog in git 1.5.\n\nSigned-off-by: Theodore Ts'o <tytso@mit.edu>\n---\n guilt |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex ced441b..7cb52c4 100755\n--- a/guilt\n+++ b/guilt\n@@ -248,6 +248,10 @@ function push_patch\n \n \t\texport GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL\n \tfi\n+\tlocal backup_author_date=\"$GIT_AUTHOR_DATE\"\n+\tlocal backup_committer_date=\"$GIT_COMMITTER_DATE\"\n+\texport GIT_AUTHOR_DATE=`stat -c %y $p`\n+\texport GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE\n \n \t# commit\n \tlocal treeish=`git-write-tree`\n@@ -271,6 +275,16 @@ function push_patch\n \t\t\tunset GIT_AUTHOR_EMAIL\n \t\tfi\n \tfi\n+\tif [ ! -z \"$backup_author_date\" ]; then\n+\t\texport GIT_AUTHOR_DATE=\"$backup_author_date\"\n+\telse\n+\t\tunset GIT_AUTHOR_DATE\n+\tfi\n+\t\tif [ ! -z \"$backup_committer_date\" ]; then\n+\t\texport GIT_COMMITTER_DATE=\"$backup_committer_date\"\n+\telse\n+\t\tunset GIT_COMMITTER_DATE\n+\tfi\n \n \trm -f /tmp/guilt.msg.$$ /tmp/guilt.log.$$\n \n-- \n1.5.0.rc4.2.g4249\n"},{"id":"34262","messageId":"20070212065720.GB31806@filer.fsl.cs.sunysb.edu","threadId":"6775","inReplyTo":"11712362751442-git-send-email-tytso@mit.edu","subject":"Re: [PATCH] Use patch file's modtime as the git author and commiter date","fromName":"Josef Sipek","fromEmail":"jsipek@fsl.cs.sunysb.edu","sentAt":"2007-02-12T06:57:20Z","receivedAt":"2007-02-12T06:57:20Z","isPatch":true,"sender":{"key":"jsipek@fsl.cs.sunysb.edu","avatar":null},"body":"On Sun, Feb 11, 2007 at 06:24:35PM -0500, Theodore Ts'o wrote:\n> By using the same author and committer date, it keeps the git commit\n> id's stable if the patches haven't changed.  Otherwise, repeated\n> invocations of \"guilt pop -a; guilt push -a\" will create new commit's\n> with different commit dates, creating a lot of garbage commits that\n> won't disappear for a LONG time, even after running \"git-gc --prune\",\n> thanks to the reflog in git 1.5.\n\nApplied. Thanks.\n\nJosef \"Jeff\" Sipek.\n\n-- \nReal Programmers consider \"what you see is what you get\" to be just as bad a\nconcept in Text Editors as it is in women. No, the Real Programmer wants a\n\"you asked for it, you got it\" text editor -- complicated, cryptic,\npowerful, unforgiving, dangerous.\n"}]}