{"thread":{"id":"42810","subject":"[PATCH] guilt: update reflog with annotations of guilt-command being run","startedAt":"2016-07-09T22:16:51Z","lastAt":"2016-08-11T14:07:31Z","messageCount":2,"participants":["Theodore Ts'o","Josef 'Jeff' Sipek"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"291109","messageId":"1468102565-326-1-git-send-email-tytso@mit.edu","threadId":"42810","inReplyTo":null,"subject":"[PATCH] guilt: update reflog with annotations of guilt-command being run","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2016-07-09T22:16:05Z","receivedAt":"2016-07-09T22:16:51Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"Many of the updates made by guilt use git update-ref, which means that\nthe output of \"git reflog\" is extremely unedifying, e.g:\n\nff0031d HEAD@{177}: reset: moving to ff0031d848a0cd7002606f9feef958de8d5edf19\n90f4305 HEAD@{178}:\na638d43 HEAD@{179}:\nff0031d HEAD@{180}:\n079788d HEAD@{181}:\n87a6280 HEAD@{182}:\n5b9554d HEAD@{183}:\nde9e918 HEAD@{184}: reset: moving to de9e9181bc066d63d78b768e95b5d949e2a8673a\n5b9554d HEAD@{185}:\n\nSo teach guilt to use the \"set_reflog_action\" helper, and since\ngit-update-ref doesn't respect the GIT_REFLOG_ACTION environment\nvariable, use its -m option so that \"git reflog\" can look like this\ninstead:\n\n1eaa566 HEAD@{11}: guilt-push: track-more-dependencies-on-transaction-commit\nab714af HEAD@{12}: guilt-push: move-lockdep-tracking-to-journal_s\n7a4b188 HEAD@{13}: guilt-push: move-lockdep-instrumentation-for-jbd2-handles\n78d9625 HEAD@{14}: guilt-push: respect-nobarrier-mount-option-in-nojournal-mode\nd08854f HEAD@{15}: guilt-pop: updating HEAD\nd08854f HEAD@{16}: guilt-pop: updating HEAD\nd08854f HEAD@{17}: guilt-push: optimize-ext4_should_retry_alloc-to-improve-ENOSPC-performance\n\nSigned-off-by: Theodore Ts'o <tytso@mit.edu>\nCc: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n---\n guilt | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/guilt b/guilt\nindex 35177b9..38d426b 100755\n--- a/guilt\n+++ b/guilt\n@@ -114,6 +114,7 @@ if [ $# -ne 0 ]; then\n \t\tdisp \"\" >&2\n \t\texit 1\n \tfi\n+\tset_reflog_action \"guilt-$CMDNAME\"\n \n \tshift\n else\n@@ -640,7 +641,7 @@ commit()\n \t\tcommitish=`git commit-tree $treeish -p $2 < \"$TMP_MSG\"`\n \t\tif $old_style_prefix || git rev-parse --verify --quiet refs/heads/$GUILT_PREFIX$branch >/dev/null\n \t\tthen\n-\t\t\tgit update-ref HEAD $commitish\n+\t\t\tgit update-ref -m \"$GIT_REFLOG_ACTION\" HEAD $commitish\n \t\telse\n \t\t\tgit branch $GUILT_PREFIX$branch $commitish\n \t\t\tgit symbolic-ref HEAD refs/heads/$GUILT_PREFIX$branch\n@@ -687,7 +688,8 @@ push_patch()\n \t\t\tfi\n \t\tfi\n \n-\t\tcommit \"$pname\" HEAD\n+\t\tGIT_REFLOG_ACTION=\"$GIT_REFLOG_ACTION: $pname\" \\\n+\t\t\tcommit \"$pname\" HEAD\n \n \t\techo \"$pname\" >> \"$applied\"\n \n-- \n2.5.0\n\n"},{"id":"293710","messageId":"20160811140104.GC1483@meili","threadId":"42810","inReplyTo":"1468102565-326-1-git-send-email-tytso@mit.edu","subject":"Re: [PATCH] guilt: update reflog with annotations of guilt-command being run","fromName":"Josef 'Jeff' Sipek","fromEmail":"jeffpc@josefsipek.net","sentAt":"2016-08-11T14:01:04Z","receivedAt":"2016-08-11T14:07:31Z","isPatch":true,"sender":{"key":"jeffpc@josefsipek.net","avatar":null},"body":"On Sat, Jul 09, 2016 at 18:16:05 -0400, Theodore Ts'o wrote:\n> Many of the updates made by guilt use git update-ref, which means that\n> the output of \"git reflog\" is extremely unedifying, e.g:\n\nThis has been an annoyance for me as well.  Thanks for fixing it.  I'll give\nit a test run, and likely push it out later today.\n\nJeff.\n\n> ff0031d HEAD@{177}: reset: moving to ff0031d848a0cd7002606f9feef958de8d5edf19\n> 90f4305 HEAD@{178}:\n> a638d43 HEAD@{179}:\n> ff0031d HEAD@{180}:\n> 079788d HEAD@{181}:\n> 87a6280 HEAD@{182}:\n> 5b9554d HEAD@{183}:\n> de9e918 HEAD@{184}: reset: moving to de9e9181bc066d63d78b768e95b5d949e2a8673a\n> 5b9554d HEAD@{185}:\n> \n> So teach guilt to use the \"set_reflog_action\" helper, and since\n> git-update-ref doesn't respect the GIT_REFLOG_ACTION environment\n> variable, use its -m option so that \"git reflog\" can look like this\n> instead:\n> \n> 1eaa566 HEAD@{11}: guilt-push: track-more-dependencies-on-transaction-commit\n> ab714af HEAD@{12}: guilt-push: move-lockdep-tracking-to-journal_s\n> 7a4b188 HEAD@{13}: guilt-push: move-lockdep-instrumentation-for-jbd2-handles\n> 78d9625 HEAD@{14}: guilt-push: respect-nobarrier-mount-option-in-nojournal-mode\n> d08854f HEAD@{15}: guilt-pop: updating HEAD\n> d08854f HEAD@{16}: guilt-pop: updating HEAD\n> d08854f HEAD@{17}: guilt-push: optimize-ext4_should_retry_alloc-to-improve-ENOSPC-performance\n> \n> Signed-off-by: Theodore Ts'o <tytso@mit.edu>\n> Cc: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>\n> ---\n>  guilt | 6 ++++--\n>  1 file changed, 4 insertions(+), 2 deletions(-)\n> \n> diff --git a/guilt b/guilt\n> index 35177b9..38d426b 100755\n> --- a/guilt\n> +++ b/guilt\n> @@ -114,6 +114,7 @@ if [ $# -ne 0 ]; then\n>  \t\tdisp \"\" >&2\n>  \t\texit 1\n>  \tfi\n> +\tset_reflog_action \"guilt-$CMDNAME\"\n>  \n>  \tshift\n>  else\n> @@ -640,7 +641,7 @@ commit()\n>  \t\tcommitish=`git commit-tree $treeish -p $2 < \"$TMP_MSG\"`\n>  \t\tif $old_style_prefix || git rev-parse --verify --quiet refs/heads/$GUILT_PREFIX$branch >/dev/null\n>  \t\tthen\n> -\t\t\tgit update-ref HEAD $commitish\n> +\t\t\tgit update-ref -m \"$GIT_REFLOG_ACTION\" HEAD $commitish\n>  \t\telse\n>  \t\t\tgit branch $GUILT_PREFIX$branch $commitish\n>  \t\t\tgit symbolic-ref HEAD refs/heads/$GUILT_PREFIX$branch\n> @@ -687,7 +688,8 @@ push_patch()\n>  \t\t\tfi\n>  \t\tfi\n>  \n> -\t\tcommit \"$pname\" HEAD\n> +\t\tGIT_REFLOG_ACTION=\"$GIT_REFLOG_ACTION: $pname\" \\\n> +\t\t\tcommit \"$pname\" HEAD\n>  \n>  \t\techo \"$pname\" >> \"$applied\"\n>  \n> -- \n> 2.5.0\n> \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"}]}