From: Junio C Hamano <gitster@pobox.com>
To: Pat Thoyts <patthoyts@users.sourceforge.net>
Cc: git@vger.kernel.org, Orgad Shaneh <orgads@gmail.com>
Subject: Re: [PATCH] git-gui: Do not reset author details on amend
Date: Thu, 05 May 2016 10:22:55 -0700 [thread overview]
Message-ID: <xmqqwpn8bes0.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1462458182-4488-1-git-send-email-orgads@gmail.com> (Orgad Shaneh's message of "Thu, 5 May 2016 17:23:02 +0300")
Pat, we haven't heard from you for a long time. Are you still
around and interested in helping us by maintaining git-gui?
Otherwise we may have to start recruiting a volunteer or two to take
this over.
Thanks.
Orgad Shaneh <orgads@gmail.com> writes:
> git commit --amend preserves the author details unless --reset-author is
> given.
>
> git-gui discards the author details on amend.
>
> Fix by reading the author details along with the commit message, and
> setting the appropriate environment variables required for preserving
> them.
>
> Reported long ago in the mailing list[1].
>
> [1] http://article.gmane.org/gmane.comp.version-control.git/243921
>
> Signed-off-by: Orgad Shaneh <orgads@gmail.com>
> ---
> git-gui/lib/commit.tcl | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
> index 864b687..60edf99 100644
> --- a/git-gui/lib/commit.tcl
> +++ b/git-gui/lib/commit.tcl
> @@ -1,8 +1,13 @@
> # git-gui misc. commit reading/writing support
> # Copyright (C) 2006, 2007 Shawn Pearce
>
> +set author_name ""
> +set author_email ""
> +set author_date ""
> +
> proc load_last_commit {} {
> global HEAD PARENT MERGE_HEAD commit_type ui_comm
> + global author_name author_email author_date
> global repo_config
>
> if {[llength $PARENT] == 0} {
> @@ -34,6 +39,10 @@ You are currently in the middle of a merge that has not been fully completed. Y
> lappend parents [string range $line 7 end]
> } elseif {[string match {encoding *} $line]} {
> set enc [string tolower [string range $line 9 end]]
> + } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} {
> + set author_name $name
> + set author_email $email
> + set author_date $time
> }
> }
> set msg [read $fd]
> @@ -107,8 +116,12 @@ proc do_signoff {} {
>
> proc create_new_commit {} {
> global commit_type ui_comm
> + global author_name author_email author_date
>
> set commit_type normal
> + set author_name ""
> + set author_email ""
> + set author_date ""
> $ui_comm delete 0.0 end
> $ui_comm edit reset
> $ui_comm edit modified false
> @@ -327,6 +340,7 @@ proc commit_committree {fd_wt curHEAD msg_p} {
> global ui_comm selected_commit_type
> global file_states selected_paths rescan_active
> global repo_config
> + global env author_name author_email author_date
>
> gets $fd_wt tree_id
> if {[catch {close $fd_wt} err]} {
> @@ -366,6 +380,11 @@ A rescan will be automatically started now.
> }
> }
>
> + if {$author_name ne ""} {
> + set env(GIT_AUTHOR_NAME) $author_name
> + set env(GIT_AUTHOR_EMAIL) $author_email
> + set env(GIT_AUTHOR_DATE) $author_date
> + }
> # -- Create the commit.
> #
> set cmd [list commit-tree $tree_id]
next prev parent reply other threads:[~2016-05-05 17:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-05 14:23 [PATCH] git-gui: Do not reset author details on amend Orgad Shaneh
2016-05-05 17:22 ` Junio C Hamano [this message]
2016-05-18 6:12 ` Orgad Shaneh
2016-07-10 4:36 ` Orgad Shaneh
2016-09-26 20:06 ` Orgad Shaneh
2016-09-26 21:34 ` Junio C Hamano
2016-09-27 7:22 ` Orgad Shaneh
2016-09-27 16:31 ` Junio C Hamano
2016-09-27 17:23 ` Orgad Shaneh
2016-09-27 17:45 ` Stefan Beller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwpn8bes0.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=orgads@gmail.com \
--cc=patthoyts@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).