{"thread":{"id":"19869","subject":"[PATCH 2/2] rebase -i: use some kind of config file to save author information","startedAt":"2009-06-20T02:34:12Z","lastAt":"2009-06-24T04:36:04Z","messageCount":13,"participants":["Christian Couder","Jakub Narebski","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"116650","messageId":"20090620023413.3995.3630.chriscool@tuxfamily.org","threadId":"19869","inReplyTo":null,"subject":"[PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-20T02:34:12Z","receivedAt":"2009-06-20T02:34:12Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"This is better than saving in a shell script, because it will make\nit much easier to port \"rebase -i\" to C. This also removes some sed\nregexps and some \"eval\"s.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n git-rebase--interactive.sh |   78 +++++++++++++++++++++++---------------------\n 1 files changed, 41 insertions(+), 37 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 92e2523..73f888a 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -40,6 +40,7 @@ MSG=\"$DOTEST\"/message\n SQUASH_MSG=\"$DOTEST\"/message-squash\n REWRITTEN=\"$DOTEST\"/rewritten\n DROPPED=\"$DOTEST\"/dropped\n+SAVE_AUTHOR_INFO=\"$DOTEST\"/save-author-info\n PRESERVE_MERGES=\n STRATEGY=\n ONTO=\n@@ -117,30 +118,31 @@ mark_action_done () {\n }\n \n get_author_ident_from_commit () {\n-\tpick_author_script='\n-\t/^author /{\n-\t\ts/'\\''/'\\''\\\\'\\'\\''/g\n-\t\th\n-\t\ts/^author \\([^<]*\\) <[^>]*> .*$/\\1/\n-\t\ts/'\\''/'\\''\\'\\'\\''/g\n-\t\ts/.*/GIT_AUTHOR_NAME='\\''&'\\''/p\n-\n-\t\tg\n-\t\ts/^author [^<]* <\\([^>]*\\)> .*$/\\1/\n-\t\ts/'\\''/'\\''\\'\\'\\''/g\n-\t\ts/.*/GIT_AUTHOR_EMAIL='\\''&'\\''/p\n-\n-\t\tg\n-\t\ts/^author [^<]* <[^>]*> \\(.*\\)$/\\1/\n-\t\ts/'\\''/'\\''\\'\\'\\''/g\n-\t\ts/.*/GIT_AUTHOR_DATE='\\''&'\\''/p\n-\n-\t\tq\n-\t}\n-\t'\n-\tencoding=$(git config i18n.commitencoding || echo UTF-8)\n-\tgit show -s --pretty=raw --encoding=\"$encoding\" \"$1\" -- |\n-\tLANG=C LC_ALL=C sed -ne \"$pick_author_script\"\n+\tencoding=$(git config i18n.commitencoding || echo UTF-8) &&\n+\tauthor_ident_name=$(git show -s --pretty=\"format:%an\" \\\n+\t\t--encoding=\"$encoding\" \"$1\" --) &&\n+\tauthor_ident_mail=$(git show -s --pretty=\"format:%ae\" \\\n+\t\t--encoding=\"$encoding\" \"$1\" --) &&\n+\tauthor_ident_date=$(git show -s --pretty=\"format:%ai\" \\\n+\t\t--encoding=\"$encoding\" \"$1\" --)\n+}\n+\n+save_author_ident () {\n+\tGIT_CONFIG=\"$SAVE_AUTHOR_INFO\" git config rebase.author.name \\\n+\t\t\"$author_ident_name\" &&\n+\tGIT_CONFIG=\"$SAVE_AUTHOR_INFO\" git config rebase.author.mail \\\n+\t\t\"$author_ident_mail\" &&\n+\tGIT_CONFIG=\"$SAVE_AUTHOR_INFO\" git config rebase.author.date \\\n+\t\t\"$author_ident_date\"\n+}\n+\n+load_author_ident () {\n+\tGIT_AUTHOR_NAME=$(GIT_CONFIG=\"$SAVE_AUTHOR_INFO\" \\\n+\t\tgit config rebase.author.name) &&\n+\tGIT_AUTHOR_EMAIL=$(GIT_CONFIG=\"$SAVE_AUTHOR_INFO\" \\\n+\t\tgit config rebase.author.mail) &&\n+\tGIT_AUTHOR_DATE=$(GIT_CONFIG=\"$SAVE_AUTHOR_INFO\" \\\n+\t\tgit config rebase.author.date)\n }\n \n make_patch () {\n@@ -158,8 +160,10 @@ make_patch () {\n \tesac > \"$DOTEST\"/patch\n \ttest -f \"$DOTEST\"/message ||\n \t\tgit cat-file commit \"$1\" | sed \"1,/^$/d\" > \"$DOTEST\"/message\n-\ttest -f \"$DOTEST\"/author-script ||\n-\t\tget_author_ident_from_commit \"$1\" > \"$DOTEST\"/author-script\n+\ttest -f \"$SAVE_AUTHOR_INFO\" || {\n+\t\tget_author_ident_from_commit \"$1\"\n+\t\tsave_author_ident\n+\t}\n }\n \n die_with_patch () {\n@@ -294,8 +298,10 @@ pick_one_preserving_merges () {\n \t\t\ttest \"a$1\" = a-n && die \"Refusing to squash a merge: $sha1\"\n \n \t\t\t# redo merge\n-\t\t\tauthor_script=$(get_author_ident_from_commit $sha1)\n-\t\t\teval \"$author_script\"\n+\t\t\tget_author_ident_from_commit $sha1\n+\t\t\tGIT_AUTHOR_NAME=\"$author_ident_name\"\n+\t\t\tGIT_AUTHOR_EMAIL=\"$author_ident_mail\"\n+\t\t\tGIT_AUTHOR_DATE=\"$author_ident_date\"\n \t\t\tmsg=\"$(git cat-file commit $sha1 | sed -e '1,/^$/d')\"\n \t\t\t# No point in merging the first parent, that's HEAD\n \t\t\tnew_parents=${new_parents# $first_parent}\n@@ -353,8 +359,7 @@ peek_next_command () {\n }\n \n do_next () {\n-\trm -f \"$DOTEST\"/message \"$DOTEST\"/author-script \\\n-\t\t\"$DOTEST\"/amend || exit\n+\trm -f \"$DOTEST\"/message \"$DOTEST\"/amend \"$SAVE_AUTHOR_INFO\" || exit\n \tread command sha1 rest < \"$TODO\"\n \tcase \"$command\" in\n \t'#'*|''|noop)\n@@ -395,7 +400,7 @@ do_next () {\n \t\tmark_action_done\n \t\tmake_squash_message $sha1 > \"$MSG\"\n \t\tfailed=f\n-\t\tauthor_script=$(get_author_ident_from_commit HEAD)\n+\t\tget_author_ident_from_commit HEAD\n \t\toutput git reset --soft HEAD^\n \t\tpick_one -n $sha1 || failed=t\n \t\tcase \"$(peek_next_command)\" in\n@@ -414,14 +419,13 @@ do_next () {\n \t\t\trm -f \"$GIT_DIR\"/MERGE_MSG || exit\n \t\t\t;;\n \t\tesac\n-\t\techo \"$author_script\" > \"$DOTEST\"/author-script\n+\t\tsave_author_ident\n \t\tif test $failed = f\n \t\tthen\n \t\t\t# This is like --amend, but with a different message\n-\t\t\teval \"$author_script\"\n-\t\t\tGIT_AUTHOR_NAME=\"$GIT_AUTHOR_NAME\" \\\n-\t\t\tGIT_AUTHOR_EMAIL=\"$GIT_AUTHOR_EMAIL\" \\\n-\t\t\tGIT_AUTHOR_DATE=\"$GIT_AUTHOR_DATE\" \\\n+\t\t\tGIT_AUTHOR_NAME=\"$author_ident_name\" \\\n+\t\t\tGIT_AUTHOR_EMAIL=\"$author_ident_mail\" \\\n+\t\t\tGIT_AUTHOR_DATE=\"$author_ident_date\" \\\n \t\t\t$USE_OUTPUT git commit --no-verify \\\n \t\t\t\t$MSG_OPT \"$EDIT_OR_FILE\" || failed=t\n \t\tfi\n@@ -536,7 +540,7 @@ do\n \t\tthen\n \t\t\t: Nothing to commit -- skip this\n \t\telse\n-\t\t\t. \"$DOTEST\"/author-script ||\n+\t\t\tload_author_ident ||\n \t\t\t\tdie \"Cannot find the author identity\"\n \t\t\tamend=\n \t\t\tif test -f \"$DOTEST\"/amend\n-- \n1.6.3.GIT\n"},{"id":"116666","messageId":"m3ab43gsrm.fsf@localhost.localdomain","threadId":"19869","inReplyTo":"20090620023413.3995.3630.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-06-20T09:27:00Z","receivedAt":"2009-06-20T09:27:00Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> Subject: [PATCH 2/2] rebase -i: use some kind of config file to save author information\n\nErrr... \"kind of\" config file?  I'd say use config file format for\nsaving author information.\n\n>\n> This is better than saving in a shell script, because it will make\n> it much easier to port \"rebase -i\" to C. This also removes some sed\n> regexps and some \"eval\"s.\n\nWould it?  Well, I guess that at least we will avoid problems with\nshell quoting and shell variable expansion rules.\n\n> \n> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n> ---\n>  git-rebase--interactive.sh |   78 +++++++++++++++++++++++---------------------\n>  1 files changed, 41 insertions(+), 37 deletions(-)\n> \n> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> +save_author_ident () {\n> +\tGIT_CONFIG=\"$SAVE_AUTHOR_INFO\" git config rebase.author.name \\\n> +\t\t\"$author_ident_name\" &&\n> +\tGIT_CONFIG=\"$SAVE_AUTHOR_INFO\" git config rebase.author.mail \\\n> +\t\t\"$author_ident_mail\" &&\n> +\tGIT_CONFIG=\"$SAVE_AUTHOR_INFO\" git config rebase.author.date \\\n> +\t\t\"$author_ident_date\"\n> +}\n> +\n> +load_author_ident () {\n> +\tGIT_AUTHOR_NAME=$(GIT_CONFIG=\"$SAVE_AUTHOR_INFO\" \\\n> +\t\tgit config rebase.author.name) &&\n> +\tGIT_AUTHOR_EMAIL=$(GIT_CONFIG=\"$SAVE_AUTHOR_INFO\" \\\n> +\t\tgit config rebase.author.mail) &&\n> +\tGIT_AUTHOR_DATE=$(GIT_CONFIG=\"$SAVE_AUTHOR_INFO\" \\\n> +\t\tgit config rebase.author.date)\n>  }\n\nWhy not use --file=<filename> option of git-config instead?\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"116692","messageId":"200906210715.36965.chriscool@tuxfamily.org","threadId":"19869","inReplyTo":"m3ab43gsrm.fsf@localhost.localdomain","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-21T05:15:36Z","receivedAt":"2009-06-21T05:15:36Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Saturday 20 June 2009, Jakub Narebski wrote:\n> Christian Couder <chriscool@tuxfamily.org> writes:\n> > Subject: [PATCH 2/2] rebase -i: use some kind of config file to save\n> > author information\n>\n> Errr... \"kind of\" config file?  I'd say use config file format for\n> saving author information.\n\nOk, I changed this in the patch series I just sent.\n\n> > This is better than saving in a shell script, because it will make\n> > it much easier to port \"rebase -i\" to C. This also removes some sed\n> > regexps and some \"eval\"s.\n>\n> Would it?  Well, I guess that at least we will avoid problems with\n> shell quoting and shell variable expansion rules.\n\nYeah.\n\n> > +load_author_ident () {\n> > +\tGIT_AUTHOR_NAME=$(GIT_CONFIG=\"$SAVE_AUTHOR_INFO\" \\\n> > +\t\tgit config rebase.author.name) &&\n> > +\tGIT_AUTHOR_EMAIL=$(GIT_CONFIG=\"$SAVE_AUTHOR_INFO\" \\\n> > +\t\tgit config rebase.author.mail) &&\n> > +\tGIT_AUTHOR_DATE=$(GIT_CONFIG=\"$SAVE_AUTHOR_INFO\" \\\n> > +\t\tgit config rebase.author.date)\n> >  }\n>\n> Why not use --file=<filename> option of git-config instead?\n\nThat's a good idea. I changed that too.\n\nThanks,\nChristian.\n"},{"id":"116723","messageId":"alpine.DEB.1.00.0906212354030.26154@pacific.mpi-cbg.de","threadId":"19869","inReplyTo":"20090620023413.3995.3630.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-21T21:55:16Z","receivedAt":"2009-06-21T21:55:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 20 Jun 2009, Christian Couder wrote:\n\n> This is better than saving in a shell script, because it will make\n> it much easier to port \"rebase -i\" to C. This also removes some sed\n> regexps and some \"eval\"s.\n\nIt will not make it easier to port \"rebase -i\" to C, as this is an \ninternal file.  The user is not supposed to touch it at all.  Only \"rebase \n-i\".  So it would be very easy to just use a different on-disk format when \nturning \"rebase -i\" into a builtin.\n\nCiao,\nDscho\n"},{"id":"116728","messageId":"7v1vpdqiv2.fsf@alter.siamese.dyndns.org","threadId":"19869","inReplyTo":"alpine.DEB.1.00.0906212354030.26154@pacific.mpi-cbg.de","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-21T23:15:13Z","receivedAt":"2009-06-21T23:15:13Z","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> On Sat, 20 Jun 2009, Christian Couder wrote:\n>\n>> This is better than saving in a shell script, because it will make\n>> it much easier to port \"rebase -i\" to C. This also removes some sed\n>> regexps and some \"eval\"s.\n>\n> It will not make it easier to port \"rebase -i\" to C, as this is an \n> internal file.  The user is not supposed to touch it at all.  Only \"rebase \n> -i\".  So it would be very easy to just use a different on-disk format when \n> turning \"rebase -i\" into a builtin.\n\n\"This is an internal file\" is just a declaration you are making, and the\nfile is observable by anybody after \"rebase -i\" relinquishes the control\nto let the user sort out the mess.  The users do not have any obligation\nto honor your declaration, and strictly speaking it is a regression to\nchange the file format.\n\nFor example, when I realize I misspelt somebody's name (perhaps the\nmailpath between the sender and me mishandled the encoding headers), I\ncould edit .git/rebase-merge/author-script and say \"git rebase --continue\"\nto let auto-amend to kick in, which would use the fixed author name from\nthe file.\n\n\tSide note.  The current \"rebase --continue\" behaviour is somewhat\n\tinconsistent; if \"edit\" does not do anything to the tree, nor the\n\tuser runs \"git commit --amend', the commit is untouched, but if\n\tthe user updates the index and says --continue without amending,\n\tthe authorship is not taken from the auto-amended commit but is\n\ttaken from the author-script file.  Perhaps something along the\n\tline of untested patch attached at the end would remedy this a\n\tbit? \n\nHaving said that, if we were to change the way rebase-i leaves its state\nbehind so that it can pick up from where it left off, I prefer Christian's\nlater suggestion to leave the object name of the commit that is being\nrebased in the file.  Sure, it makes it harder to lie about the authorship,\nbut my previous example was purely \"I _could_ do this\" and not \"I rely on\nbeing able to do this\".\n\nBut I have this nagging feeling that we may be able to get rid of even the\n\"current commit\".\n\n-- >8 --\n\nrebase -i: AUTHOR_{NAME,EMAIL,DATE} are already available in HEAD; use it.\n\nThis only changes the codepath of \"rebase -i --continue\" that auto-amends\nthe HEAD commit with the change user made but forgot to \"commit --amend\".\n\n git-rebase--interactive.sh |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex f96d887..b8608be 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -522,8 +522,7 @@ first and then run 'git rebase --continue' again.\"\n \t\t\t\tgit reset --soft HEAD^ ||\n \t\t\t\tdie \"Cannot rewind the HEAD\"\n \t\t\tfi\n-\t\t\texport GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&\n-\t\t\tgit commit --no-verify -F \"$DOTEST\"/message -e || {\n+\t\t\tgit commit --no-verify -c HEAD || {\n \t\t\t\ttest -n \"$amend\" && git reset --soft $amend\n \t\t\t\tdie \"Could not commit staged changes.\"\n \t\t\t}\n"},{"id":"116737","messageId":"200906220650.27685.chriscool@tuxfamily.org","threadId":"19869","inReplyTo":"7v1vpdqiv2.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-22T04:50:27Z","receivedAt":"2009-06-22T04:50:27Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Monday 22 June 2009, Junio C Hamano wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > On Sat, 20 Jun 2009, Christian Couder wrote:\n> >> This is better than saving in a shell script, because it will make\n> >> it much easier to port \"rebase -i\" to C. This also removes some sed\n> >> regexps and some \"eval\"s.\n> >\n> > It will not make it easier to port \"rebase -i\" to C, as this is an\n> > internal file.  The user is not supposed to touch it at all.  Only\n> > \"rebase -i\".  So it would be very easy to just use a different on-disk\n> > format when turning \"rebase -i\" into a builtin.\n\nI'd rather port \"rebase -i\" to C step by step like I started \nporting \"bisect\". So changing the format to something easier to deal with \nin C makes it easier to port.\n\n> \"This is an internal file\" is just a declaration you are making, and the\n> file is observable by anybody after \"rebase -i\" relinquishes the control\n> to let the user sort out the mess.  The users do not have any obligation\n> to honor your declaration, and strictly speaking it is a regression to\n> change the file format.\n>\n> For example, when I realize I misspelt somebody's name (perhaps the\n> mailpath between the sender and me mishandled the encoding headers), I\n> could edit .git/rebase-merge/author-script and say \"git rebase\n> --continue\" to let auto-amend to kick in, which would use the fixed\n> author name from the file.\n>\n> \tSide note.  The current \"rebase --continue\" behaviour is somewhat\n> \tinconsistent; if \"edit\" does not do anything to the tree, nor the\n> \tuser runs \"git commit --amend', the commit is untouched, but if\n> \tthe user updates the index and says --continue without amending,\n> \tthe authorship is not taken from the auto-amended commit but is\n> \ttaken from the author-script file.  Perhaps something along the\n> \tline of untested patch attached at the end would remedy this a\n> \tbit?\n\nInteresting. I will try it.\n\n> Having said that, if we were to change the way rebase-i leaves its state\n> behind so that it can pick up from where it left off, I prefer\n> Christian's later suggestion to leave the object name of the commit that\n> is being rebased in the file.  Sure, it makes it harder to lie about the\n> authorship, but my previous example was purely \"I _could_ do this\" and\n> not \"I rely on being able to do this\".\n\nI just sent a v3 where the commit sha1 is saved in the file, so you can \nchoose between v2 and v3 what behavior you prefer.\n\n> But I have this nagging feeling that we may be able to get rid of even\n> the \"current commit\".\n\nI will have a look at that.\n\nThanks,\nChristian.\n"},{"id":"116749","messageId":"alpine.DEB.1.00.0906221117270.4168@intel-tinevez-2-302","threadId":"19869","inReplyTo":"7v1vpdqiv2.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-22T09:19:50Z","receivedAt":"2009-06-22T09:19:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 21 Jun 2009, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Sat, 20 Jun 2009, Christian Couder wrote:\n> >\n> >> This is better than saving in a shell script, because it will make\n> >> it much easier to port \"rebase -i\" to C. This also removes some sed\n> >> regexps and some \"eval\"s.\n> >\n> > It will not make it easier to port \"rebase -i\" to C, as this is an \n> > internal file.  The user is not supposed to touch it at all.  Only \"rebase \n> > -i\".  So it would be very easy to just use a different on-disk format when \n> > turning \"rebase -i\" into a builtin.\n> \n> \"This is an internal file\" is just a declaration you are making, and the\n> file is observable by anybody after \"rebase -i\" relinquishes the control\n> to let the user sort out the mess.\n\nIt is an observation I am making.  Sure, the file is observable by the \nuser.  But it is hidden deep inside .git/ and users who change things \ninside .git/ (with the exception of config) are asking for trouble.\n\nI really do not see the point of changing the file format _before_ turning \nrebase -i into C.\n\nOh, and I do not see the point of turning rebase -i into C before finally \npolishing sequencer so it can go into git.git's master.\n\nCiao,\nDscho\n"},{"id":"116801","messageId":"200906230657.48627.chriscool@tuxfamily.org","threadId":"19869","inReplyTo":"7v1vpdqiv2.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-23T04:57:47Z","receivedAt":"2009-06-23T04:57:47Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Monday 22 June 2009, Junio C Hamano wrote:\n>\n> rebase -i: AUTHOR_{NAME,EMAIL,DATE} are already available in HEAD; use\n> it.\n>\n> This only changes the codepath of \"rebase -i --continue\" that auto-amends\n> the HEAD commit with the change user made but forgot to \"commit --amend\".\n>\n>  git-rebase--interactive.sh |    3 +--\n>  1 files changed, 1 insertions(+), 2 deletions(-)\n>\n> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> index f96d887..b8608be 100755\n> --- a/git-rebase--interactive.sh\n> +++ b/git-rebase--interactive.sh\n> @@ -522,8 +522,7 @@ first and then run 'git rebase --continue' again.\"\n>  \t\t\t\tgit reset --soft HEAD^ ||\n>  \t\t\t\tdie \"Cannot rewind the HEAD\"\n>  \t\t\tfi\n> -\t\t\texport GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE &&\n> -\t\t\tgit commit --no-verify -F \"$DOTEST\"/message -e || {\n> +\t\t\tgit commit --no-verify -c HEAD || {\n>  \t\t\t\ttest -n \"$amend\" && git reset --soft $amend\n>  \t\t\t\tdie \"Could not commit staged changes.\"\n>  \t\t\t}\n\nThis patch would use the message from HEAD instead of \"$DOTEST\"/message, but \nit looks like we are changing \"$DOTEST\"/message sometimes with \nthe \"make_squash_message\" function.\n\nBest regards,\nChristian.\n"},{"id":"116802","messageId":"7vljnja5dv.fsf@alter.siamese.dyndns.org","threadId":"19869","inReplyTo":"200906230657.48627.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-23T05:25:16Z","receivedAt":"2009-06-23T05:25:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <chriscool@tuxfamily.org> writes:\n\n> This patch would use the message from HEAD instead of \"$DOTEST\"/message, but \n> it looks like we are changing \"$DOTEST\"/message sometimes with \n> the \"make_squash_message\" function.\n\nHeh, that is why it was \"something along this line\" patch ;-)\n\nRegarding the C rewrite vs rebase--i.sh update, I tend to agree with Dscho\nthat changing the scripted Porcelain is not worth it if we are rewriting\nthe whole thing in C soon.  But perhaps we can allow combinations of the\ntwo options (\"-[cC] commit\" and \"-F file\") given to \"git commit\"?  The\nintent of the caller in such a case is quite clear---use the authorship\nbut do use the message from the other source (if we do this, it would\nprobably make sense to do that also for \"-m message\").  The version\nentirely written in C obviously does not even need such an option (it can\nread authorship from HEAD and use its own message), but the point is if\ngoing that route would eliminate the need to store \"which commit were we\ndealing with when we gave the control back\" information on disk.  I\nsuspect that the sequencing information is already on disk (i.e. $TODO\nfile) and author-script may be redundant information.\n"},{"id":"116804","messageId":"200906230730.01456.chriscool@tuxfamily.org","threadId":"19869","inReplyTo":"alpine.DEB.1.00.0906221117270.4168@intel-tinevez-2-302","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-23T05:30:01Z","receivedAt":"2009-06-23T05:30:01Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Monday 22 June 2009, Johannes Schindelin wrote:\n> Hi,\n>\n> On Sun, 21 Jun 2009, Junio C Hamano wrote:\n> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > > On Sat, 20 Jun 2009, Christian Couder wrote:\n> > >> This is better than saving in a shell script, because it will make\n> > >> it much easier to port \"rebase -i\" to C. This also removes some sed\n> > >> regexps and some \"eval\"s.\n> > >\n> > > It will not make it easier to port \"rebase -i\" to C, as this is an\n> > > internal file.  The user is not supposed to touch it at all.  Only\n> > > \"rebase -i\".  So it would be very easy to just use a different\n> > > on-disk format when turning \"rebase -i\" into a builtin.\n> >\n> > \"This is an internal file\" is just a declaration you are making, and\n> > the file is observable by anybody after \"rebase -i\" relinquishes the\n> > control to let the user sort out the mess.\n>\n> It is an observation I am making.  Sure, the file is observable by the\n> user.  But it is hidden deep inside .git/ and users who change things\n> inside .git/ (with the exception of config) are asking for trouble.\n>\n> I really do not see the point of changing the file format _before_\n> turning rebase -i into C.\n>\n> Oh, and I do not see the point of turning rebase -i into C before finally\n> polishing sequencer so it can go into git.git's master.\n\nThe problem with this is that it will take a lot of time to implement the \nfeatures that have been added to rebase -i since the sequencer stalled, \nthen to polish it, and to get it reviewed and so on, and during that time \nother features or changes may be implemented by other people.\n\nSo I prefer to use code from the current sequencer (at \nhttp://repo.or.cz/w/git/sbeyer.git) to start porting step by step rebase -i \nto C.\n\nRegards,\nChristian.\n"},{"id":"116810","messageId":"alpine.DEB.1.00.0906231137220.5252@intel-tinevez-2-302","threadId":"19869","inReplyTo":"200906230730.01456.chriscool@tuxfamily.org","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-23T09:40:49Z","receivedAt":"2009-06-23T09:40:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 Jun 2009, Christian Couder wrote:\n\n> On Monday 22 June 2009, Johannes Schindelin wrote:\n>\n> > On Sun, 21 Jun 2009, Junio C Hamano wrote:\n> > > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > > > On Sat, 20 Jun 2009, Christian Couder wrote:\n> > > >> This is better than saving in a shell script, because it will \n> > > >> make it much easier to port \"rebase -i\" to C. This also removes \n> > > >> some sed regexps and some \"eval\"s.\n> > > >\n> > > > It will not make it easier to port \"rebase -i\" to C, as this is an \n> > > > internal file.  The user is not supposed to touch it at all.  \n> > > > Only \"rebase -i\".  So it would be very easy to just use a \n> > > > different on-disk format when turning \"rebase -i\" into a builtin.\n> > >\n> > > \"This is an internal file\" is just a declaration you are making, and \n> > > the file is observable by anybody after \"rebase -i\" relinquishes the \n> > > control to let the user sort out the mess.\n> >\n> > It is an observation I am making.  Sure, the file is observable by the \n> > user.  But it is hidden deep inside .git/ and users who change things \n> > inside .git/ (with the exception of config) are asking for trouble.\n> >\n> > I really do not see the point of changing the file format _before_ \n> > turning rebase -i into C.\n> >\n> > Oh, and I do not see the point of turning rebase -i into C before \n> > finally polishing sequencer so it can go into git.git's master.\n> \n> The problem with this is that it will take a lot of time to implement \n> the features that have been added to rebase -i since the sequencer \n> stalled, then to polish it, and to get it reviewed and so on, and during \n> that time other features or changes may be implemented by other people.\n> \n> So I prefer to use code from the current sequencer (at \n> http://repo.or.cz/w/git/sbeyer.git) to start porting step by step rebase \n> -i to C.\n\nI think that the best way to go forward would be to have something like \nfetch--tool, i.e. a builtin helper that successively takes more and more \nfunctionality into C.\n\nIMHO a first sensible step would be to implement the commands (\"pick\", \n\"squash\", \"edit\") in such a helper, and call them from do_next().\n\nThat should take care of the most difficult part, getting the transition \nstarted.\n\nBut I had the impression that the sequencer started out almost like this, \nbut then it also wanted to implement the do_next() and everything.\n\nCiao,\nDscho\n"},{"id":"116846","messageId":"200906240629.40138.chriscool@tuxfamily.org","threadId":"19869","inReplyTo":"7vljnja5dv.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-24T04:29:39Z","receivedAt":"2009-06-24T04:29:39Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tuesday 23 June 2009, Junio C Hamano wrote:\n> Christian Couder <chriscool@tuxfamily.org> writes:\n> > This patch would use the message from HEAD instead of\n> > \"$DOTEST\"/message, but it looks like we are changing \"$DOTEST\"/message\n> > sometimes with the \"make_squash_message\" function.\n>\n> Heh, that is why it was \"something along this line\" patch ;-)\n>\n> Regarding the C rewrite vs rebase--i.sh update, I tend to agree with\n> Dscho that changing the scripted Porcelain is not worth it if we are\n> rewriting the whole thing in C soon.  But perhaps we can allow\n> combinations of the two options (\"-[cC] commit\" and \"-F file\") given to\n> \"git commit\"?\n\nI agree that it would be nice.\n\n> The intent of the caller in such a case is quite \n> clear---use the authorship but do use the message from the other source\n> (if we do this, it would probably make sense to do that also for \"-m\n> message\").  The version entirely written in C obviously does not even\n> need such an option (it can read authorship from HEAD and use its own\n> message), but the point is if going that route would eliminate the need\n> to store \"which commit were we dealing with when we gave the control\n> back\" information on disk.  I suspect that the sequencing information is\n> already on disk (i.e. $TODO file) and author-script may be redundant\n> information.\n\nYeah, perhaps we could ge this route, but I'd rather just port what I can \nstep by step first and then polish and/or rewrite some parts than the other \nway around.\n\nThanks,\nChristian.\n"},{"id":"116848","messageId":"200906240636.04675.chriscool@tuxfamily.org","threadId":"19869","inReplyTo":"alpine.DEB.1.00.0906231137220.5252@intel-tinevez-2-302","subject":"Re: [PATCH 2/2] rebase -i: use some kind of config file to save author information","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2009-06-24T04:36:04Z","receivedAt":"2009-06-24T04:36:04Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Hi,\n\nOn Tuesday 23 June 2009, Johannes Schindelin wrote:\n> Hi,\n>\n> On Tue, 23 Jun 2009, Christian Couder wrote:\n> > The problem with this is that it will take a lot of time to implement\n> > the features that have been added to rebase -i since the sequencer\n> > stalled, then to polish it, and to get it reviewed and so on, and\n> > during that time other features or changes may be implemented by other\n> > people.\n> >\n> > So I prefer to use code from the current sequencer (at\n> > http://repo.or.cz/w/git/sbeyer.git) to start porting step by step\n> > rebase -i to C.\n>\n> I think that the best way to go forward would be to have something like\n> fetch--tool, i.e. a builtin helper that successively takes more and more\n> functionality into C.\n\nYeah, I started working on something like that.\n\n> IMHO a first sensible step would be to implement the commands (\"pick\",\n> \"squash\", \"edit\") in such a helper, and call them from do_next().\n>\n> That should take care of the most difficult part, getting the transition\n> started.\n\nI agree that it looks like a good way forward.\n\n> But I had the impression that the sequencer started out almost like this,\n> but then it also wanted to implement the do_next() and everything.\n\nYeah, I think at some steps we got something close to that.\n\nThanks,\nChristian.\n"}]}