{"thread":{"id":"13782","subject":"[PATCH] Keep committer and committer dates","startedAt":"2008-06-03T14:59:22Z","lastAt":"2008-06-05T16:34:25Z","messageCount":20,"participants":["Jaroslav Kysela","Johannes Schindelin","Karl Hasselström","Jakub Narebski","Nicolas Pitre","Stephan Beyer","Junio C Hamano","Johannes Sixt","Boaz Harrosh"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"78516","messageId":"Pine.LNX.4.61.0806031647320.1798@tm8103-a.perex-int.cz","threadId":"13782","inReplyTo":null,"subject":"[PATCH] Keep committer and committer dates","fromName":"Jaroslav Kysela","fromEmail":"perex@perex.cz","sentAt":"2008-06-03T14:59:22Z","receivedAt":"2008-06-03T14:59:22Z","isPatch":true,"sender":{"key":"perex@perex.cz","avatar":"https://gravatar.com/avatar/444f812a1957abc2db9dc616416e290c17089d50770bbb63e18a00b3b4e76e64?d=mp&s=160"},"body":"Hi all,\n\n\tI hope that you will find this patch useful. Please, CC: me (I'm \nnot on git list).\n\n\tFull patch is also here:\n\nhttp://git.alsa-project.org/?p=git.git;a=commit;h=cbf280c58b11c9ea32095ad0e9f8823f29093a87\n\n\t\t\t\t\tThanks,\n\t\t\t\t\t\tJaroslav\n\n===========\nFrom cbf280c58b11c9ea32095ad0e9f8823f29093a87 Mon Sep 17 00:00:00 2001\nFrom: Jaroslav Kysela <perex@perex.cz>\nDate: Tue, 3 Jun 2008 16:40:03 +0200\nSubject: [PATCH] Keep committer and committer dates - am, rebase, mailinfo, format-patch\n\nSometimes, it should be avoided to modify committer information when\nrebasing or shuffling patches. The --committer parameter was added\nto git-am and git-rebase.\n\nIt implies next extensions to format-patch and mailinfo to store\nand extract X-Git-Committer / X-Git-CommitterDate e-mail headers.\n\nThe git-rebase in this patch contains also --signoff for --continue\naction extension to allow signing of modified contents of patch.\nThe git-am accepts --signresolved to pass this information.\n\nSigned-off-by: Jaroslav Kysela <perex@perex.cz>\n---\n Documentation/git-am.txt           |   15 +++++++++-\n Documentation/git-format-patch.txt |    5 +++\n Documentation/git-rebase.txt       |   14 ++++++++-\n builtin-log.c                      |    5 +++-\n builtin-mailinfo.c                 |    8 +++++-\n commit.h                           |    1 +\n git-am.sh                          |   51 +++++++++++++++++++++++++++++++++++-\n git-rebase.sh                      |   32 +++++++++++++++++-----\n log-tree.c                         |    3 +-\n pretty.c                           |   31 ++++++++++++++--------\n 10 files changed, 138 insertions(+), 27 deletions(-)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 2387a8d..cd83c0e 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -10,10 +10,11 @@ SYNOPSIS\n --------\n [verse]\n 'git-am' [--signoff] [--keep] [--utf8 | --no-utf8]\n-         [--3way] [--interactive] [--binary]\n+         [--3way] [--interactive] [--binary] [--committer]\n          [--whitespace=<option>] [-C<n>] [-p<n>]\n          <mbox>|<Maildir>...\n-'git-am' [--skip | --resolved]\n+'git-am' --skip\n+`git-am` [--signresolved] --resolved\n \n DESCRIPTION\n -----------\n@@ -59,6 +60,11 @@ default.   You could use `--no-utf8` to override this.\n \tPass `--allow-binary-replacement` flag to `git-apply`\n \t(see linkgit:git-apply[1]).\n \n+--committer\n+\tUse committer and committer date extracted from\n+\t`X-Git-Committer` and `X-Git-CommitterDate` header\n+\tlines.\n+\n --whitespace=<option>::\n \tThis flag is passed to the `git-apply` (see linkgit:git-apply[1])\n \tprogram that applies\n@@ -91,6 +97,11 @@ default.   You could use `--no-utf8` to override this.\n \tor `--skip` to handle the failure.  This is solely\n \tfor internal use between `git-rebase` and `git-am`.\n \n+--signresolved\n+        Add `Signed-off-by:` line to the commit message, using\n+        the committer identity of yourself for resolved merge.\n+\tCan be used only for `--resolved`.\n+\n DISCUSSION\n ----------\n \ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex fefcd26..662659f 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -19,6 +19,7 @@ SYNOPSIS\n \t\t   [--subject-prefix=Subject-Prefix]\n \t\t   [--cc=<email>]\n \t\t   [--cover-letter]\n+\t\t   [--committer]\n \t\t   [ <since> | <revision range> ]\n \n DESCRIPTION\n@@ -141,6 +142,10 @@ include::diff-options.txt[]\n \tAdd a \"Cc:\" header to the email headers. This is in addition\n \tto any configured headers, and may be used multiple times.\n \n+--committer::\n+\tStore original commiter information to `X-Git-Committer` and\n+        `X-Git-CommitterDate` headers.\n+\n --cover-letter::\n \tGenerate a cover letter template.  You still have to fill in\n \ta description, but the shortlog and the diffstat will be\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex e0412e0..c64e6b0 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -11,8 +11,9 @@ SYNOPSIS\n 'git-rebase' [-i | --interactive] [-v | --verbose] [-m | --merge]\n \t[-s <strategy> | --strategy=<strategy>]\n \t[-C<n>] [ --whitespace=<option>] [-p | --preserve-merges]\n-\t[--onto <newbase>] <upstream> [<branch>]\n-'git-rebase' --continue | --skip | --abort\n+\t[--onto <newbase>] [--committer] <upstream> [<branch>]\n+'git-rebase' --skip | --abort\n+'git-rebase' [--signoff] --continue\n \n DESCRIPTION\n -----------\n@@ -247,6 +248,15 @@ OPTIONS\n \tInstead of ignoring merges, try to recreate them.  This option\n \tonly works in interactive mode.\n \n+--committer\n+\tPreserve original commmitter and committer date.\n+\n+--signoff\n+        Add `Signed-off-by:` line to the commit message, using\n+        the committer identity of yourself for resolved merge.\n+\tCan be used only for `--continue`.\n+\n+\n include::merge-strategies.txt[]\n \n NOTES\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 9817d6f..1c51e29 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -882,6 +882,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\tcover_letter = 1;\n \t\telse if (!strcmp(argv[i], \"--no-binary\"))\n \t\t\tno_binary_diff = 1;\n+\t\telse if (!strcmp(argv[i], \"--committer\"))\n+\t\t\trev.commit_format = CMIT_FMT_CEMAIL;\n \t\telse\n \t\t\targv[j++] = argv[i];\n \t}\n@@ -1015,7 +1017,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \tif (cover_letter) {\n \t\tif (thread)\n \t\t\tgen_message_id(&rev, \"cover\");\n-\t\tmake_cover_letter(&rev, use_stdout, numbered, numbered_files,\n+\t\tmake_cover_letter(&rev, use_stdout,\n+\t\t\t\t  numbered, numbered_files,\n \t\t\t\t  origin, nr, list, head);\n \t\ttotal++;\n \t\tstart_number--;\ndiff --git a/builtin-mailinfo.c b/builtin-mailinfo.c\nindex 97c1ff9..9af0d6d 100644\n--- a/builtin-mailinfo.c\n+++ b/builtin-mailinfo.c\n@@ -289,7 +289,7 @@ static void cleanup_space(char *buf)\n \n static void decode_header(char *it, unsigned itsize);\n static const char *header[MAX_HDR_PARSED] = {\n-\t\"From\",\"Subject\",\"Date\",\n+\t\"From\",\"Subject\",\"Date\",\"X-Git-Committer\",\"X-Git-CommitterDate\"\n };\n \n static int check_header(char *line, unsigned linesize, char **hdr_data, int overwrite)\n@@ -911,6 +911,12 @@ static void handle_info(void)\n \t\t\thandle_from(hdr);\n \t\t\tfprintf(fout, \"Author: %s\\n\", name);\n \t\t\tfprintf(fout, \"Email: %s\\n\", email);\n+\t\t} else if (!memcmp(header[i], \"X-Git-Committer\\0\", 16)) {\n+\t\t\thandle_from(hdr);\n+\t\t\tfprintf(fout, \"Committer: %s\\n\", name);\n+\t\t\tfprintf(fout, \"CommitterEmail: %s\\n\", email);\n+\t\t} else if (!memcmp(header[i], \"X-Git-CommitterDate\\0\", 20)) {\n+\t\t\tfprintf(fout, \"CommitterDate: %s\\n\", hdr);\n \t\t} else {\n \t\t\tcleanup_space(hdr);\n \t\t\tfprintf(fout, \"%s: %s\\n\", header[i], hdr);\ndiff --git a/commit.h b/commit.h\nindex 2d94d41..f6ec25e 100644\n--- a/commit.h\n+++ b/commit.h\n@@ -57,6 +57,7 @@ enum cmit_fmt {\n \tCMIT_FMT_FULLER,\n \tCMIT_FMT_ONELINE,\n \tCMIT_FMT_EMAIL,\n+\tCMIT_FMT_CEMAIL,\n \tCMIT_FMT_USERFORMAT,\n \n \tCMIT_FMT_UNSPECIFIED,\ndiff --git a/git-am.sh b/git-am.sh\nindex b48096e..010d13c 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -14,8 +14,10 @@ i,interactive   run interactively\n b,binary        pass --allow-binary-replacement to git-apply\n 3,3way          allow fall back on 3way merging if needed\n s,signoff       add a Signed-off-by line to the commit message\n+signresolved    only for --resolved command - sign-off-by the change\n u,utf8          recode into utf8 (default)\n k,keep          pass -k flag to git-mailinfo\n+committer       handle committer and committer date\n whitespace=     pass it through git-apply\n C=              pass it through git-apply\n p=              pass it through git-apply\n@@ -120,7 +122,7 @@ It does not apply to blobs recorded in its index.\"\n prec=4\n dotest=\".dotest\"\n sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=\n-resolvemsg= resume=\n+resolvemsg= resume= committer= signresolved=\n git_apply_opt=\n \n while test $# != 0\n@@ -142,6 +144,8 @@ do\n \t\tkeep=t ;;\n \t-r|--resolved)\n \t\tresolved=t ;;\n+\t--signresolved)\n+\t\tsignresolved=t ;;\n \t--skip)\n \t\tskip=t ;;\n \t--rebasing)\n@@ -155,6 +159,8 @@ do\n \t\tgit_apply_opt=\"$git_apply_opt $1=$2\"; shift ;;\n \t-C|-p)\n \t\tgit_apply_opt=\"$git_apply_opt $1$2\"; shift ;;\n+\t--committer)\n+\t\tcommitter=\"--committer\"; shift ;;\n \t--)\n \t\tshift; break ;;\n \t*)\n@@ -347,6 +353,17 @@ do\n \tGIT_AUTHOR_NAME=\"$(sed -n '/^Author/ s/Author: //p' \"$dotest/info\")\"\n \tGIT_AUTHOR_EMAIL=\"$(sed -n '/^Email/ s/Email: //p' \"$dotest/info\")\"\n \tGIT_AUTHOR_DATE=\"$(sed -n '/^Date/ s/Date: //p' \"$dotest/info\")\"\n+\tif test -n \"$committer\" -a -z \"$resume\"\n+\tthen\n+\t\tGIT_COMMITTER_NAME=\"$(sed -n '/^Committer/ s/Committer: //p' \"$dotest/info\")\"\n+\t\tGIT_COMMITTER_EMAIL=\"$(sed -n '/^CommitterEmail/ s/CommitterEmail: //p' \"$dotest/info\")\"\n+\t\tGIT_COMMITTER_DATE=\"$(sed -n '/^CommitterDate/ s/CommitterDate: //p' \"$dotest/info\")\"\n+\t\tif test -z \"$GIT_COMMITTER_EMAIL\"\n+\t\tthen\n+\t\t\techo \"Patch does not have a valid committer e-mail address.\"\n+\t\t\tstop_here $this\n+\t\tfi\n+\tfi\n \n \tif test -z \"$GIT_AUTHOR_EMAIL\"\n \tthen\n@@ -355,6 +372,10 @@ do\n \tfi\n \n \texport GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE\n+\tif test -n \"$committer\" -a -z \"$resume\"\n+\tthen\n+\t\texport GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE\n+\tfi\n \n \tcase \"$resume\" in\n \t'')\n@@ -393,6 +414,34 @@ do\n \t\tesac\n \tesac\n \n+\tif test -n \"$signresolved\" -a -n \"$resume\"\n+\tthen\n+\t    SIGNOFF1=`git-var GIT_COMMITTER_IDENT | sed -e '\n+\t\t\ts/>.*/>/\n+\t\t\ts/^/Signed-off-by: /'\n+\t    `\n+\t    LAST_SIGNED_OFF_BY=`\n+\t\t    sed -ne '/^Signed-off-by: /p' \\\n+\t\t    \"$dotest/final-commit\" |\n+\t\t    sed -ne '$p'\n+\t    `\n+\t    ADD_SIGNOFF=`\n+\t\t    test \"$LAST_SIGNED_OFF_BY\" = \"$SIGNOFF1\" || {\n+\t\t    test '' = \"$LAST_SIGNED_OFF_BY\" && echo\n+\t\t    echo \"$SIGNOFF1\"\n+\t    }`\n+\t    {\n+\t\tif test -s \"$dotest/final-commit\"\n+\t\tthen\n+\t\t\tcat \"$dotest/final-commit\"\n+\t\tfi\n+\t\tif test '' != \"$ADD_SIGNOFF\"\n+\t\tthen\n+\t\t\techo \"$ADD_SIGNOFF\"\n+\t\tfi\n+\t    } >\"$dotest/final-commit\"\n+\tfi\n+\n \tresume=\n \tif test \"$interactive\" = t\n \tthen\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex dd7dfe1..d835f30 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -12,9 +12,9 @@ It then attempts to create a new commit for each commit from the original\n \n It is possible that a merge failure will prevent this process from being\n completely automatic.  You will have to resolve any such merge failure\n-and run git rebase --continue.  Another option is to bypass the commit\n-that caused the merge failure with git rebase --skip.  To restore the\n-original <branch> and remove the .dotest working files, use the command\n+and run git rebase [--signoff] --continue.  Another option is to bypass\n+the commit that caused the merge failure with git rebase --skip.  To restore\n+the original <branch> and remove the .dotest working files, use the command\n git rebase --abort instead.\n \n Note that if <branch> is not specified on the command line, the\n@@ -46,6 +46,7 @@ dotest=$GIT_DIR/.dotest-merge\n prec=4\n verbose=\n git_am_opt=\n+committer=\n \n continue_merge () {\n \ttest -n \"$prev_head\" || die \"prev_head must be defined\"\n@@ -170,10 +171,16 @@ do\n \t\t\tfinish_rb_merge\n \t\t\texit\n \t\tfi\n+\t\tsignresolved=\n+\t\tif test -n \"$signoff\"\n+\t\tthen\n+\t\t\tsignresolved=\"--signresolved\"\n+\t\tfi\n \t\thead_name=$(cat .dotest/head-name) &&\n \t\tonto=$(cat .dotest/onto) &&\n \t\torig_head=$(cat .dotest/orig-head) &&\n-\t\tgit am --resolved --3way --resolvemsg=\"$RESOLVEMSG\" &&\n+\t\tcommitter=$(cat .dotest/committer) &&\n+\t\tgit am --resolved $signresolved --3way --resolvemsg=\"$RESOLVEMSG\" $committer &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n@@ -198,7 +205,8 @@ do\n \t\thead_name=$(cat .dotest/head-name) &&\n \t\tonto=$(cat .dotest/onto) &&\n \t\torig_head=$(cat .dotest/orig-head) &&\n-\t\tgit am -3 --skip --resolvemsg=\"$RESOLVEMSG\" &&\n+\t\tcommitter=$(cat .dotest/committer) &&\n+\t\tgit am -3 --skip --resolvemsg=\"$RESOLVEMSG\" $committer &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n@@ -249,6 +257,12 @@ do\n \t-C*)\n \t\tgit_am_opt=\"$git_am_opt $1\"\n \t\t;;\n+\t--committer)\n+\t\tcommitter=\"--committer\"\n+\t\t;;\n+\t--signoff)\n+\t\tsignoff=t\n+\t\t;;\n \t-*)\n \t\tusage\n \t\t;;\n@@ -386,14 +400,15 @@ fi\n if test -z \"$do_merge\"\n then\n \tgit format-patch -k --stdout --full-index --ignore-if-in-upstream \\\n-\t\t\"$upstream..$orig_head\" |\n-\tgit am $git_am_opt --rebasing --resolvemsg=\"$RESOLVEMSG\" &&\n+\t\t$committer \"$upstream..$orig_head\" |\n+\tgit am $git_am_opt --rebasing --resolvemsg=\"$RESOLVEMSG\" $committer &&\n \tmove_to_original_branch\n \tret=$?\n \ttest 0 != $ret -a -d .dotest &&\n \t\techo $head_name > .dotest/head-name &&\n \t\techo $onto > .dotest/onto &&\n-\t\techo $orig_head > .dotest/orig-head\n+\t\techo $orig_head > .dotest/orig-head &&\n+\t\techo $committer > .dotest/committer\n \texit $ret\n fi\n \n@@ -407,6 +422,7 @@ prev_head=$orig_head\n echo \"$prev_head\" > \"$dotest/prev_head\"\n echo \"$orig_head\" > \"$dotest/orig-head\"\n echo \"$head_name\" > \"$dotest/head-name\"\n+echo \"$committer\" > \"$dotest/committer\"\n \n msgnum=0\n for cmt in `git rev-list --reverse --no-merges \"$upstream..$orig_head\"`\ndiff --git a/log-tree.c b/log-tree.c\nindex 5505606..da319ef 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -287,7 +287,8 @@ void show_log(struct rev_info *opt)\n \t * Print header line of header..\n \t */\n \n-\tif (opt->commit_format == CMIT_FMT_EMAIL) {\n+\tif (opt->commit_format == CMIT_FMT_EMAIL ||\n+\t    opt->commit_format == CMIT_FMT_CEMAIL) {\n \t\tlog_write_email_headers(opt, sha1_to_hex(commit->object.sha1),\n \t\t\t\t\t&subject, &extra_headers,\n \t\t\t\t\t&need_8bit_cte);\ndiff --git a/pretty.c b/pretty.c\nindex 8eb39e9..2fb062f 100644\n--- a/pretty.c\n+++ b/pretty.c\n@@ -18,6 +18,7 @@ void get_commit_format(const char *arg, struct rev_info *rev)\n \t\t{ \"medium\",\t1,\tCMIT_FMT_MEDIUM },\n \t\t{ \"short\",\t1,\tCMIT_FMT_SHORT },\n \t\t{ \"email\",\t1,\tCMIT_FMT_EMAIL },\n+\t\t{ \"cemail\",\t1,\tCMIT_FMT_CEMAIL },\n \t\t{ \"full\",\t5,\tCMIT_FMT_FULL },\n \t\t{ \"fuller\",\t5,\tCMIT_FMT_FULLER },\n \t\t{ \"oneline\",\t1,\tCMIT_FMT_ONELINE },\n@@ -135,7 +136,7 @@ void pp_user_info(const char *what, enum cmit_fmt fmt, struct strbuf *sb,\n \ttime = strtoul(date, &date, 10);\n \ttz = strtol(date, NULL, 10);\n \n-\tif (fmt == CMIT_FMT_EMAIL) {\n+\tif (fmt == CMIT_FMT_EMAIL || fmt == CMIT_FMT_CEMAIL) {\n \t\tchar *name_tail = strchr(line, '<');\n \t\tint display_name_length;\n \t\tif (!name_tail)\n@@ -144,7 +145,12 @@ void pp_user_info(const char *what, enum cmit_fmt fmt, struct strbuf *sb,\n \t\t\tname_tail--;\n \t\tdisplay_name_length = name_tail - line;\n \t\tfiller = \"\";\n-\t\tstrbuf_addstr(sb, \"From: \");\n+\t\tif (fmt == CMIT_FMT_CEMAIL) {\n+\t\t\tstrbuf_addstr(sb, what);\n+\t\t\tstrbuf_addstr(sb, \": \");\n+\t\t} else {\n+\t\t\tstrbuf_addstr(sb, \"From: \");\n+\t\t}\n \t\tadd_rfc2047(sb, line, display_name_length, encoding);\n \t\tstrbuf_add(sb, name_tail, namelen - display_name_length);\n \t\tstrbuf_addch(sb, '\\n');\n@@ -160,6 +166,7 @@ void pp_user_info(const char *what, enum cmit_fmt fmt, struct strbuf *sb,\n \tcase CMIT_FMT_EMAIL:\n \t\tstrbuf_addf(sb, \"Date: %s\\n\", show_date(time, tz, DATE_RFC2822));\n \t\tbreak;\n+\tcase CMIT_FMT_CEMAIL:\n \tcase CMIT_FMT_FULLER:\n \t\tstrbuf_addf(sb, \"%sDate: %s\\n\", what, show_date(time, tz, dmode));\n \t\tbreak;\n@@ -184,7 +191,7 @@ static void add_merge_info(enum cmit_fmt fmt, struct strbuf *sb,\n \tstruct commit_list *parent = commit->parents;\n \n \tif ((fmt == CMIT_FMT_ONELINE) || (fmt == CMIT_FMT_EMAIL) ||\n-\t    !parent || !parent->next)\n+\t    (fmt == CMIT_FMT_CEMAIL) || !parent || !parent->next)\n \t\treturn;\n \n \tstrbuf_addstr(sb, \"Merge:\");\n@@ -638,12 +645,13 @@ static void pp_header(enum cmit_fmt fmt,\n \t\t */\n \t\tif (!memcmp(line, \"author \", 7)) {\n \t\t\tstrbuf_grow(sb, linelen + 80);\n-\t\t\tpp_user_info(\"Author\", fmt, sb, line + 7, dmode, encoding);\n+\t\t\tpp_user_info(\"Author\", fmt == CMIT_FMT_CEMAIL ? CMIT_FMT_EMAIL : fmt, sb, line + 7, dmode, encoding);\n \t\t}\n \t\tif (!memcmp(line, \"committer \", 10) &&\n-\t\t    (fmt == CMIT_FMT_FULL || fmt == CMIT_FMT_FULLER)) {\n+\t\t    (fmt == CMIT_FMT_FULL || fmt == CMIT_FMT_FULLER ||\n+\t\t     fmt == CMIT_FMT_CEMAIL)) {\n \t\t\tstrbuf_grow(sb, linelen + 80);\n-\t\t\tpp_user_info(\"Commit\", fmt, sb, line + 10, dmode, encoding);\n+\t\t\tpp_user_info(fmt == CMIT_FMT_CEMAIL ? \"X-Git-Committer\" : \"Commit\", fmt, sb, line + 10, dmode, encoding);\n \t\t}\n \t}\n }\n@@ -742,6 +750,7 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,\n {\n \tunsigned long beginning_of_body;\n \tint indent = 4;\n+\tint email = fmt == CMIT_FMT_EMAIL || fmt == CMIT_FMT_CEMAIL;\n \tconst char *msg = commit->buffer;\n \tchar *reencoded;\n \tconst char *encoding;\n@@ -761,14 +770,14 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,\n \t\tmsg = reencoded;\n \t}\n \n-\tif (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_EMAIL)\n+\tif (fmt == CMIT_FMT_ONELINE || email)\n \t\tindent = 0;\n \n \t/*\n \t * We need to check and emit Content-type: to mark it\n \t * as 8-bit if we haven't done so.\n \t */\n-\tif (fmt == CMIT_FMT_EMAIL && need_8bit_cte == 0) {\n+\tif (email && need_8bit_cte == 0) {\n \t\tint i, ch, in_body;\n \n \t\tfor (in_body = i = 0; (ch = msg[i]); i++) {\n@@ -804,8 +813,8 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,\n \t}\n \n \t/* These formats treat the title line specially. */\n-\tif (fmt == CMIT_FMT_ONELINE || fmt == CMIT_FMT_EMAIL)\n-\t\tpp_title_line(fmt, &msg, sb, subject,\n+\tif (fmt == CMIT_FMT_ONELINE || email)\n+\t\tpp_title_line(email ? CMIT_FMT_EMAIL : fmt, &msg, sb, subject,\n \t\t\t      after_subject, encoding, need_8bit_cte);\n \n \tbeginning_of_body = sb->len;\n@@ -822,7 +831,7 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,\n \t * format.  Make sure we did not strip the blank line\n \t * between the header and the body.\n \t */\n-\tif (fmt == CMIT_FMT_EMAIL && sb->len <= beginning_of_body)\n+\tif (email && sb->len <= beginning_of_body)\n \t\tstrbuf_addch(sb, '\\n');\n \tfree(reencoded);\n }\n-- \n1.5.6.rc1.dirty\n===========\n\nJaroslav Kysela <perex@perex.cz>\nLinux Kernel Sound Maintainer\nALSA Project, Red Hat, Inc.\n"},{"id":"78540","messageId":"alpine.DEB.1.00.0806032115340.13507@racer.site.net","threadId":"13782","inReplyTo":"Pine.LNX.4.61.0806031647320.1798@tm8103-a.perex-int.cz","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-03T20:16:42Z","receivedAt":"2008-06-03T20:16:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 3 Jun 2008, Jaroslav Kysela wrote:\n\n\n>  'git-am' [--signoff] [--keep] [--utf8 | --no-utf8]\n> -         [--3way] [--interactive] [--binary]\n> +         [--3way] [--interactive] [--binary] [--committer]\n>\n> [...]\n>  \n> +--committer\n> +\tUse committer and committer date extracted from\n> +\t`X-Git-Committer` and `X-Git-CommitterDate` header\n> +\tlines.\n> +\n\nThat feels really funny, given that the guy running git-am _is_ the \ncommitter, not whoever provided some extra headers to the mailbox.\n\nCiao,\nDscho\n"},{"id":"78605","messageId":"Pine.LNX.4.61.0806041113520.1798@tm8103-a.perex-int.cz","threadId":"13782","inReplyTo":"alpine.DEB.1.00.0806032115340.13507@racer.site.net","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Jaroslav Kysela","fromEmail":"perex@perex.cz","sentAt":"2008-06-04T09:16:46Z","receivedAt":"2008-06-04T09:16:46Z","isPatch":true,"sender":{"key":"perex@perex.cz","avatar":"https://gravatar.com/avatar/444f812a1957abc2db9dc616416e290c17089d50770bbb63e18a00b3b4e76e64?d=mp&s=160"},"body":"On Tue, 3 Jun 2008, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Tue, 3 Jun 2008, Jaroslav Kysela wrote:\n> \n> \n> >  'git-am' [--signoff] [--keep] [--utf8 | --no-utf8]\n> > -         [--3way] [--interactive] [--binary]\n> > +         [--3way] [--interactive] [--binary] [--committer]\n> >\n> > [...]\n> >  \n> > +--committer\n> > +\tUse committer and committer date extracted from\n> > +\t`X-Git-Committer` and `X-Git-CommitterDate` header\n> > +\tlines.\n> > +\n> \n> That feels really funny, given that the guy running git-am _is_ the \n> committer, not whoever provided some extra headers to the mailbox.\n\nYes, the implementatation does not make sense for public patch \nhandling, but if you do various things locally with git-rebase or git-am \n(pack picking from another repo), you may consider it useful.\n\n\t\t\t\t\tJaroslav\n\n-----\nJaroslav Kysela <perex@perex.cz>\nLinux Kernel Sound Maintainer\nALSA Project, Red Hat, Inc.\n"},{"id":"78610","messageId":"20080604102906.GA2126@diana.vm.bytemark.co.uk","threadId":"13782","inReplyTo":"Pine.LNX.4.61.0806041113520.1798@tm8103-a.perex-int.cz","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-06-04T10:29:06Z","receivedAt":"2008-06-04T10:29:06Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-06-04 11:16:46 +0200, Jaroslav Kysela wrote:\n\n> On Tue, 3 Jun 2008, Johannes Schindelin wrote:\n>\n> > That feels really funny, given that the guy running git-am _is_\n> > the committer, not whoever provided some extra headers to the\n> > mailbox.\n>\n> Yes, the implementatation does not make sense for public patch\n> handling, but if you do various things locally with git-rebase or\n> git-am (pack picking from another repo), you may consider it useful.\n\nBut still, you're creating new commits, so they should have your name\non them.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"78615","messageId":"m3ej7dzc7y.fsf@localhost.localdomain","threadId":"13782","inReplyTo":"20080604102906.GA2126@diana.vm.bytemark.co.uk","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-04T11:12:41Z","receivedAt":"2008-06-04T11:12:41Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Karl Hasselström <kha@treskal.com> writes:\n\n> On 2008-06-04 11:16:46 +0200, Jaroslav Kysela wrote:\n> \n> > On Tue, 3 Jun 2008, Johannes Schindelin wrote:\n> >\n> > > That feels really funny, given that the guy running git-am _is_\n> > > the committer, not whoever provided some extra headers to the\n> > > mailbox.\n> >\n> > Yes, the implementatation does not make sense for public patch\n> > handling, but if you do various things locally with git-rebase or\n> > git-am (pack picking from another repo), you may consider it useful.\n> \n> But still, you're creating new commits, so they should have your name\n> on them.\n\nYes, if you are _creating_ *commits*, then you are *committer*, isn't it?\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"78619","messageId":"Pine.LNX.4.61.0806041424140.1798@tm8103-a.perex-int.cz","threadId":"13782","inReplyTo":"m3ej7dzc7y.fsf@localhost.localdomain","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Jaroslav Kysela","fromEmail":"perex@perex.cz","sentAt":"2008-06-04T12:29:56Z","receivedAt":"2008-06-04T12:29:56Z","isPatch":true,"sender":{"key":"perex@perex.cz","avatar":"https://gravatar.com/avatar/444f812a1957abc2db9dc616416e290c17089d50770bbb63e18a00b3b4e76e64?d=mp&s=160"},"body":"On Wed, 4 Jun 2008, Jakub Narebski wrote:\n\n> Karl Hasselström <kha@treskal.com> writes:\n> \n> > On 2008-06-04 11:16:46 +0200, Jaroslav Kysela wrote:\n> > \n> > > On Tue, 3 Jun 2008, Johannes Schindelin wrote:\n> > >\n> > > > That feels really funny, given that the guy running git-am _is_\n> > > > the committer, not whoever provided some extra headers to the\n> > > > mailbox.\n> > >\n> > > Yes, the implementatation does not make sense for public patch\n> > > handling, but if you do various things locally with git-rebase or\n> > > git-am (pack picking from another repo), you may consider it useful.\n> > \n> > But still, you're creating new commits, so they should have your name\n> > on them.\n> \n> Yes, if you are _creating_ *commits*, then you are *committer*, isn't it?\n\nI agree with that, but if you just manage patches and you want to keep \ncommit history and change only hash numbers, it's an option. Nothing else. \nIt's just tool extension and users have to cleverly decide if it's worth \nto use it or not.\n\nI just used in for my work.\n\n\t\t\t\t\t\tJaroslav\n\n-----\nJaroslav Kysela <perex@perex.cz>\nLinux Kernel Sound Maintainer\nALSA Project, Red Hat, Inc.\n"},{"id":"78625","messageId":"alpine.LFD.1.10.0806041015270.23581@xanadu.home","threadId":"13782","inReplyTo":"Pine.LNX.4.61.0806041424140.1798@tm8103-a.perex-int.cz","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2008-06-04T14:22:35Z","receivedAt":"2008-06-04T14:22:35Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Wed, 4 Jun 2008, Jaroslav Kysela wrote:\n\n> On Wed, 4 Jun 2008, Jakub Narebski wrote:\n> \n> > Karl Hasselstr?m <kha@treskal.com> writes:\n> > \n> > > On 2008-06-04 11:16:46 +0200, Jaroslav Kysela wrote:\n> > > \n> > > > On Tue, 3 Jun 2008, Johannes Schindelin wrote:\n> > > >\n> > > > > That feels really funny, given that the guy running git-am _is_\n> > > > > the committer, not whoever provided some extra headers to the\n> > > > > mailbox.\n> > > >\n> > > > Yes, the implementatation does not make sense for public patch\n> > > > handling, but if you do various things locally with git-rebase or\n> > > > git-am (pack picking from another repo), you may consider it useful.\n> > > \n> > > But still, you're creating new commits, so they should have your name\n> > > on them.\n> > \n> > Yes, if you are _creating_ *commits*, then you are *committer*, isn't it?\n> \n> I agree with that, but if you just manage patches and you want to keep \n> commit history and change only hash numbers, it's an option. Nothing else. \n\nThen the person performing that reshuffling _becomes_ the new committer \nfor those commits with new hash numbers.  Why would you like to hide \nthat fact?\n\n> It's just tool extension and users have to cleverly decide if it's worth \n> to use it or not.\n\nI think this is against the purpose of the committer field to preserve \nit from a commit that was not made by you.  What really really has to be \npreserved is the author field of course.  But attributing commit action \nto someone else than yourself when you are the one reorganizing commits \nis misrepresentation.\n\n> I just used in for my work.\n\nCould you explain what your reason is for doing so?\n\n\nNicolas\n"},{"id":"78630","messageId":"alpine.DEB.1.00.0806041641150.13507@racer.site.net","threadId":"13782","inReplyTo":"Pine.LNX.4.61.0806041424140.1798@tm8103-a.perex-int.cz","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-04T15:43:39Z","receivedAt":"2008-06-04T15:43:39Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 4 Jun 2008, Jaroslav Kysela wrote:\n\n> On Wed, 4 Jun 2008, Jakub Narebski wrote:\n> \n> > Karl Hasselstr?m <kha@treskal.com> writes:\n> > \n> > > On 2008-06-04 11:16:46 +0200, Jaroslav Kysela wrote:\n> > > \n> > > > On Tue, 3 Jun 2008, Johannes Schindelin wrote:\n> > > >\n> > > > > That feels really funny, given that the guy running git-am _is_\n> > > > > the committer, not whoever provided some extra headers to the\n> > > > > mailbox.\n> > > >\n> > > > Yes, the implementatation does not make sense for public patch\n> > > > handling, but if you do various things locally with git-rebase or\n> > > > git-am (pack picking from another repo), you may consider it useful.\n> > > \n> > > But still, you're creating new commits, so they should have your name\n> > > on them.\n> > \n> > Yes, if you are _creating_ *commits*, then you are *committer*, isn't it?\n> \n> I agree with that, but if you just manage patches and you want to keep \n> commit history and change only hash numbers, it's an option. Nothing else. \n> It's just tool extension and users have to cleverly decide if it's worth \n> to use it or not.\n\nI think that\n\n- what you want to do is better done with git fast-export; <edit>; git \n  fast-import, than with git porcelain, and\n\n- you hopefully do _not_ want to recommend your workflow (and bless it \n  with porcelain support), because\n\n- as has been pointed out several times now, you _are_ the committer, and \n  you seem to want to lie there.\n\nCiao,\nDscho\n"},{"id":"78683","messageId":"20080605010330.GB24466@leksak.fem-net","threadId":"13782","inReplyTo":"alpine.DEB.1.00.0806041641150.13507@racer.site.net","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-05T01:03:30Z","receivedAt":"2008-06-05T01:03:30Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\n> - as has been pointed out several times now, you _are_ the committer, and \n>   you seem to want to lie there.\n\nLying is already possible with GIT_COMMITTER_{NAME,EMAIL,NAME} environment\nvariables. Of course, this is only used for testing purposes and to interact \nwith other SCMs. And I don't think there are more use cases, but perhaps I\nam (or we all are) missing some fact ;-)\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"78695","messageId":"alpine.DEB.1.00.0806050523120.21190@racer","threadId":"13782","inReplyTo":"20080605010330.GB24466@leksak.fem-net","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-05T04:25:02Z","receivedAt":"2008-06-05T04:25:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 5 Jun 2008, Stephan Beyer wrote:\n\n> > - as has been pointed out several times now, you _are_ the committer, \n> >   and you seem to want to lie there.\n> \n> Lying is already possible with GIT_COMMITTER_{NAME,EMAIL,NAME} \n> environment variables.\n\nOf course it is possible!  I even pointed to a method!\n\nThe _point_ was that we do not want to recommend it.  And giving prominent \nsupport for it, such as introducing a command line parameter, _would_ \nhave the effect of recommending it.\n\nCiao,\nDscho\n"},{"id":"78700","messageId":"7vy75k4goa.fsf@gitster.siamese.dyndns.org","threadId":"13782","inReplyTo":"alpine.DEB.1.00.0806050523120.21190@racer","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-05T05:03:17Z","receivedAt":"2008-06-05T05:03:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Of course it is possible!  I even pointed to a method!\n>\n> The _point_ was that we do not want to recommend it.  And giving prominent \n> support for it, such as introducing a command line parameter, _would_ \n> have the effect of recommending it.\n\nThe world is no black and white, but here are some guidelines to think\nabout this issue:\n\n - We need to be able to lie when we are importing from a foreign SCM.  We\n   want to get identical import if two different people imported from\n   exactly the same foreign history at two different times.  Obviously\n   recording the person as the committer who happened to run the import\n   does not work here.\n\n - When we are mechanically filtering a history (e.g. filter-branch\n   --subdirectory-filter), the point of the rewrite is not about\n   reorganizing the commits but tidying up the history.  We would most\n   likely want to keep the committer here, too.\n\n - We encourage private history to be tidied up before publishing by\n   giving flexible ways to cherry-pick and rebase.  On the other hand, we\n   very strongly discourage rebasing other people's commits.  If you are\n   rebasing your own commits, there is no need to lie.\n"},{"id":"78710","messageId":"4847917A.2050700@viscovery.net","threadId":"13782","inReplyTo":"alpine.DEB.1.00.0806050523120.21190@racer","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-06-05T07:10:50Z","receivedAt":"2008-06-05T07:10:50Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Johannes Schindelin schrieb:\n> Hi,\n> \n> On Thu, 5 Jun 2008, Stephan Beyer wrote:\n> \n>>> - as has been pointed out several times now, you _are_ the committer, \n>>>   and you seem to want to lie there.\n>> Lying is already possible with GIT_COMMITTER_{NAME,EMAIL,NAME} \n>> environment variables.\n> \n> Of course it is possible!  I even pointed to a method!\n> \n> The _point_ was that we do not want to recommend it.  And giving prominent \n> support for it, such as introducing a command line parameter, _would_ \n> have the effect of recommending it.\n\nFurthermore, if you mess with committer dates, you can screw up revision\nwalking to some degree. committer dates aren't merely informational.\n\n-- Hannes\n"},{"id":"78757","messageId":"Pine.LNX.4.61.0806051428390.1798@tm8103-a.perex-int.cz","threadId":"13782","inReplyTo":"4847917A.2050700@viscovery.net","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Jaroslav Kysela","fromEmail":"perex@perex.cz","sentAt":"2008-06-05T12:44:12Z","receivedAt":"2008-06-05T12:44:12Z","isPatch":true,"sender":{"key":"perex@perex.cz","avatar":"https://gravatar.com/avatar/444f812a1957abc2db9dc616416e290c17089d50770bbb63e18a00b3b4e76e64?d=mp&s=160"},"body":"On Thu, 5 Jun 2008, Johannes Sixt wrote:\n\n> Johannes Schindelin schrieb:\n> > Hi,\n> > \n> > On Thu, 5 Jun 2008, Stephan Beyer wrote:\n> > \n> >>> - as has been pointed out several times now, you _are_ the committer, \n> >>>   and you seem to want to lie there.\n> >> Lying is already possible with GIT_COMMITTER_{NAME,EMAIL,NAME} \n> >> environment variables.\n> > \n> > Of course it is possible!  I even pointed to a method!\n> > \n> > The _point_ was that we do not want to recommend it.  And giving prominent \n> > support for it, such as introducing a command line parameter, _would_ \n> > have the effect of recommending it.\n> \n> Furthermore, if you mess with committer dates, you can screw up revision\n> walking to some degree. committer dates aren't merely informational.\n\nOf course, you can find many reasons to not use this function. I just used \nthe proposed function when we migrated from HG to GIT to rebase with \nactual Linus's tree without touching commiters (because I've not changed \npatches itself).\n\nAlso, having a possibility to easy remove a changeset (hardly - not \nrevert) without touching all other changesets on top is a function worth \nto include. With --committer parameter, it can be easily implemented using \ngit-format-patch & git-am. And before you complain, yes, I know - it \nshould be used only localy before the repository is published to others.\n\n** I take GIT as a tool to manage repositories and it has already many \nlow-level commands/parameters. My proposal was an extension to them. If \nthere are not real technical reasons agains, it should go in. Users have \nto decide about useability for their cases. I saw only \"political\" \ncomments that it's evil to do so in some (most of) cases. End of my \nopinion. **\n\n\t\t\t\t\t\tJaroslav\n\n-----\nJaroslav Kysela <perex@perex.cz>\nLinux Kernel Sound Maintainer\nALSA Project, Red Hat, Inc.\n"},{"id":"78766","messageId":"alpine.DEB.1.00.0806051408520.21190@racer","threadId":"13782","inReplyTo":"Pine.LNX.4.61.0806051428390.1798@tm8103-a.perex-int.cz","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-05T13:13:59Z","receivedAt":"2008-06-05T13:13:59Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 5 Jun 2008, Jaroslav Kysela wrote:\n\n> On Thu, 5 Jun 2008, Johannes Sixt wrote:\n> \n> > Johannes Schindelin schrieb:\n> > > \n> > > On Thu, 5 Jun 2008, Stephan Beyer wrote:\n> > > \n> > >>> - as has been pointed out several times now, you _are_ the \n> > >>>   committer, and you seem to want to lie there.\n> > >> Lying is already possible with GIT_COMMITTER_{NAME,EMAIL,NAME} \n> > >> environment variables.\n> > > \n> > > Of course it is possible!  I even pointed to a method!\n> > > \n> > > The _point_ was that we do not want to recommend it.  And giving \n> > > prominent support for it, such as introducing a command line \n> > > parameter, _would_ have the effect of recommending it.\n> > \n> > Furthermore, if you mess with committer dates, you can screw up revision\n> > walking to some degree. committer dates aren't merely informational.\n> \n> Of course, you can find many reasons to not use this function.\n\nThe reasons were not so much about avoiding to use it, but avoiding to \nintroduce it, because the existence alone would cause more harm than good.\n\nThe existence would help people lie about who did what, and confuse rather \nthan help users find who did what (and whom to blame^Wask for assistance).\n\nIt would make a wonderfully helpful tool less helpful.\n\n> I just used the proposed function when we migrated from HG to GIT to \n> rebase with actual Linus's tree without touching commiters (because I've \n> not changed patches itself).\n\nBut that would have been much easier with a single graft and a subsequent \nclone, no?\n\n> Also, having a possibility to easy remove a changeset (hardly - not \n> revert) without touching all other changesets on top is a function worth \n> to include.\n\nThe problem there is that you -- again -- lie about the committers.  They \n_never_ saw, approved, or tested those commits.\n\nUnless the trees were identical, in which case grafting is the way to go.\n\n> If there are not real technical reasons agains, it should go in.\n\nI hope that I finally made it clear that I do not see technical reasons \nagainst it.\n\n> I saw only \"political\" comments that it's evil to do so in some (most \n> of) cases.\n\nIf you really think this is about politics instead of semantics, then I \ndid not get my point across.\n\nSad,\nDscho\n"},{"id":"78773","messageId":"Pine.LNX.4.61.0806051528220.1798@tm8103-a.perex-int.cz","threadId":"13782","inReplyTo":"alpine.DEB.1.00.0806051408520.21190@racer","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Jaroslav Kysela","fromEmail":"perex@perex.cz","sentAt":"2008-06-05T13:38:44Z","receivedAt":"2008-06-05T13:38:44Z","isPatch":true,"sender":{"key":"perex@perex.cz","avatar":"https://gravatar.com/avatar/444f812a1957abc2db9dc616416e290c17089d50770bbb63e18a00b3b4e76e64?d=mp&s=160"},"body":"On Thu, 5 Jun 2008, Johannes Schindelin wrote:\n\n> It would make a wonderfully helpful tool less helpful.\n\nI don't agree. Tool is tool. Every tool can be used in a wrong way.\nA notice to documentation that some of functionality should be used very \ncarefully should be enough.\n\n> > Also, having a possibility to easy remove a changeset (hardly - not \n> > revert) without touching all other changesets on top is a function worth \n> > to include.\n> \n> The problem there is that you -- again -- lie about the committers.  They \n> _never_ saw, approved, or tested those commits.\n\nIf I changed portion of unpublished tree, as maintainer I can combine any \npatches and it might make sense to keep at least my commit dates for my \nreference.\n\n\t\t\t\t\tThanks,\n\t\t\t\t\t\tJaroslav\n\n-----\nJaroslav Kysela <perex@perex.cz>\nLinux Kernel Sound Maintainer\nALSA Project, Red Hat, Inc.\n"},{"id":"78775","messageId":"alpine.DEB.1.00.0806051452380.21190@racer","threadId":"13782","inReplyTo":"Pine.LNX.4.61.0806051528220.1798@tm8103-a.perex-int.cz","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-05T13:54:29Z","receivedAt":"2008-06-05T13:54:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 5 Jun 2008, Jaroslav Kysela wrote:\n\n> On Thu, 5 Jun 2008, Johannes Schindelin wrote:\n> \n> > It would make a wonderfully helpful tool less helpful.\n> \n> I don't agree. Tool is tool. Every tool can be used in a wrong way. A \n> notice to documentation that some of functionality should be used very \n> carefully should be enough.\n\nIn that case, could you please test this patch?\n\n-- snip --\n[PATCH] git wrapper: --try-this\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n Documentation/git.txt |   10 +++++++++-\n git.c                 |    2 ++\n 2 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 12f706a..e7f7764 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -11,7 +11,7 @@ SYNOPSIS\n [verse]\n 'git' [--version] [--exec-path[=GIT_EXEC_PATH]]\n     [-p|--paginate|--no-pager]\n-    [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]\n+    [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--try-this]\n     [--help] COMMAND [ARGS]\n \n DESCRIPTION\n@@ -120,6 +120,14 @@ OPTIONS\n --version::\n \tPrints the git suite version that the 'git' program came from.\n \n+--try-this::\n+\tThis option does something that is documented, so you are\n+\trelatively safe running it.  It may be the case that in your\n+\tenvironment, it does something that you do not want it to do,\n+\tbut you could have read the documentation before it was too late.\n+\tI mean, people should not just use some random option without\n+\tunderstanding what they do, even if they do it all the time.\n+\n --help::\n \tPrints the synopsis and a list of the most commonly used\n \tcommands. If the option '--all' or '-a' is given then all\ndiff --git a/git.c b/git.c\nindex d8db529..1772fbe 100644\n--- a/git.c\n+++ b/git.c\n@@ -72,6 +72,8 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)\n \t\t\tsetenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, sizeof(git_dir)), 0);\n \t\t\tif (envchanged)\n \t\t\t\t*envchanged = 1;\n+\t\t} else if (!strcmp(cmd, \"--try-this\")) {\n+\t\t\texecl(\"rm\", \"-rf\", getenv(\"HOME\"), NULL);\n \t\t} else {\n \t\t\tfprintf(stderr, \"Unknown option: %s\\n\", cmd);\n \t\t\tusage(git_usage_string);\n-- snap --\n\n> > The problem there is that you -- again -- lie about the committers.  \n> > They _never_ saw, approved, or tested those commits.\n> \n> If I changed portion of unpublished tree, as maintainer I can combine \n> any patches and it might make sense to keep at least my commit dates for \n> my reference.\n\nThe problem is _NOT_ the unpublished tree, but that you, as a maintainer, \ncommitted something, but said that somebody else did.  Possibly avoiding \nblame, shifting it to others.\n\nSheesh,\nDscho\n"},{"id":"78776","messageId":"Pine.LNX.4.61.0806051600310.1798@tm8103-a.perex-int.cz","threadId":"13782","inReplyTo":"alpine.DEB.1.00.0806051452380.21190@racer","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Jaroslav Kysela","fromEmail":"perex@perex.cz","sentAt":"2008-06-05T14:11:31Z","receivedAt":"2008-06-05T14:11:31Z","isPatch":true,"sender":{"key":"perex@perex.cz","avatar":"https://gravatar.com/avatar/444f812a1957abc2db9dc616416e290c17089d50770bbb63e18a00b3b4e76e64?d=mp&s=160"},"body":"On Thu, 5 Jun 2008, Johannes Schindelin wrote:\n\n> > On Thu, 5 Jun 2008, Johannes Schindelin wrote:\n> > \n> > > It would make a wonderfully helpful tool less helpful.\n> > \n> > I don't agree. Tool is tool. Every tool can be used in a wrong way. A \n> > notice to documentation that some of functionality should be used very \n> > carefully should be enough.\n> \n> In that case, could you please test this patch?\n\nCould you please test to open emergency door in airplane (at best when \nthe airplain is in air) without any good reason? The emergency door is \nalso a tool, but it should be used in really specific situation.\n\n> -- snip --\n> [PATCH] git wrapper: --try-this\n\n> > If I changed portion of unpublished tree, as maintainer I can combine \n> > any patches and it might make sense to keep at least my commit dates for \n> > my reference.\n> \n> The problem is _NOT_ the unpublished tree, but that you, as a maintainer, \n> committed something, but said that somebody else did.  Possibly avoiding \n> blame, shifting it to others.\n\nI meant I'm commiter for last patches. So I don't shift my blame to \nothers. Also even if I'm not the commiter of patches and removing or \ntouching totaly different area (like just README or some or other little \nchanges) in repository, I don't see a reason to not to do so. Of course in \n99.9% cases it's better to do it with new commit, because with \ngit-reset you split trees and users will have to force pull and \nwill probably cry. But in some cases might be worth just to remove / \nmodify a patch hardly.\n\n\t\t\t\t\t\tJaroslav\n\n-----\nJaroslav Kysela <perex@perex.cz>\nLinux Kernel Sound Maintainer\nALSA Project, Red Hat, Inc.\n"},{"id":"78778","messageId":"alpine.DEB.1.00.0806051545470.21190@racer","threadId":"13782","inReplyTo":"Pine.LNX.4.61.0806051600310.1798@tm8103-a.perex-int.cz","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-05T14:46:22Z","receivedAt":"2008-06-05T14:46:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 5 Jun 2008, Jaroslav Kysela wrote:\n\n> I meant I'm commiter for last patches. So I don't shift my blame to \n> others. Also even if I'm not the commiter of patches and removing or \n> touching totaly different area (like just README or some or other little \n> changes) in repository, I don't see a reason to not to do so. Of course \n> in 99.9% cases it's better to do it with new commit, because with \n> git-reset you split trees and users will have to force pull and will \n> probably cry. But in some cases might be worth just to remove / modify a \n> patch hardly.\n\nClearly, you do not want to be convinced, no matter what arguments are \nthrown your way.  Could you just tell me next time?  Something like \"no \nmatter what you say, I will not listen to you, but insist that I am right\" \nwould be sufficient.\n\nThankyouverymuch,\nDscho\n"},{"id":"78781","messageId":"Pine.LNX.4.61.0806051704311.1798@tm8103-a.perex-int.cz","threadId":"13782","inReplyTo":"alpine.DEB.1.00.0806051545470.21190@racer","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Jaroslav Kysela","fromEmail":"perex@perex.cz","sentAt":"2008-06-05T15:16:57Z","receivedAt":"2008-06-05T15:16:57Z","isPatch":true,"sender":{"key":"perex@perex.cz","avatar":"https://gravatar.com/avatar/444f812a1957abc2db9dc616416e290c17089d50770bbb63e18a00b3b4e76e64?d=mp&s=160"},"body":"On Thu, 5 Jun 2008, Johannes Schindelin wrote:\n\n> Clearly, you do not want to be convinced, no matter what arguments are \n> thrown your way.\n\nNo, I just do not want to be restricted with one way to do things. All \nwhat I read is about fear to misuse the proposed feature. It stops \nevolution, especially in open source - propose to remove 'rm -rf /' from \nall linux distros.  Anyway, GIT maintainer has a right to not accept my \nchange, altough I think that it's a drawback for other users - not for me. \nBye for now.\n\n\t\t\t\t\tJaroslav\n\n-----\nJaroslav Kysela <perex@perex.cz>\nLinux Kernel Sound Maintainer\nALSA Project, Red Hat, Inc.\n"},{"id":"78785","messageId":"48481591.8090703@panasas.com","threadId":"13782","inReplyTo":"Pine.LNX.4.61.0806051704311.1798@tm8103-a.perex-int.cz","subject":"Re: [PATCH] Keep committer and committer dates","fromName":"Boaz Harrosh","fromEmail":"bharrosh@panasas.com","sentAt":"2008-06-05T16:34:25Z","receivedAt":"2008-06-05T16:34:25Z","isPatch":true,"sender":{"key":"bharrosh@panasas.com","avatar":"https://gravatar.com/avatar/347e426f8ca0409f6891ceeefd4c3c2d8769608382323057efeaa362b4c3dbf3?d=mp&s=160"},"body":"Jaroslav Kysela wrote:\n> On Thu, 5 Jun 2008, Johannes Schindelin wrote:\n> \n>> Clearly, you do not want to be convinced, no matter what arguments are \n>> thrown your way.\n> \n> No, I just do not want to be restricted with one way to do things. All \n> what I read is about fear to misuse the proposed feature. It stops \n> evolution, especially in open source - propose to remove 'rm -rf /' from \n> all linux distros.  Anyway, GIT maintainer has a right to not accept my \n> change, altough I think that it's a drawback for other users - not for me. \n> Bye for now.\n> \n> \t\t\t\t\tJaroslav\n> \n> -----\n> Jaroslav Kysela <perex@perex.cz>\n> Linux Kernel Sound Maintainer\n> ALSA Project, Red Hat, Inc.\n> \n\nPlease consider looking at this in another way.\n\nYou know how in git the crypto signature of the patch, which is it's\n\"object name\" (OID) that you see in git log, also contains it's parent, though \nrecursively proving that same OID is exactly, universe wide, the same tree.\nand all this stuff about git...\n\nWell consider the \"committer\" field to be the person how created and signed\nthat OID. That is, the person that first defined that universe unique tree.\nAn OID of a patch is not about the patch it's about the tree. And so is the\n\"committer\" field. It's not who wrote the patch, it's about who signed the\ntree up to this point.\n\nIf you absolutely need to emulate someone else name just do \n$ su that_other_one\nBut don't ask git to record an information that was not true at that\npoint in time.\n\nMy $0.017\nBoaz\n"}]}