git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-gui: Do not reset author details on amend

From
Orgad Shaneh <orgads@gmail.com>
Date
Jul 10, 2016, 04:36 UTC
Message-ID
<CAGHpTBLgwyw_iYK927Yed+XG9ti+tKboz07-FVYWox9WoQkjOg@mail.gmail.com>
In-Reply-To
<CAGHpTBLdy9R7xvfcFWoMkvGNJjY-wM5=HfWxs8XF_yh-+2Rc3w@mail.gmail.com>
It's been over 2 months. Can anyone please review and merge it?
Thanks.
- Orgad
On Wed, May 18, 2016 at 9:12 AM, Orgad Shaneh <orgads@gmail.com> wrote:
Show 93 quoted lines
> ping?
>
> On Thu, May 5, 2016 at 8:22 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> 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]
Previous: Orgad ShanehNext: Orgad Shaneh
Message 4 of 10 in “git-gui: Do not reset author details on amend”
  1. git-gui: Do not reset author details on amendOrgad Shaneh, May 5, 2016
  2. Junio C HamanoMay 5, 2016
  3. Orgad ShanehMay 18, 2016
  4. Orgad ShanehJul 10, 2016
  5. Orgad ShanehSep 26, 2016
  6. Junio C HamanoSep 26, 2016
  7. Orgad ShanehSep 27, 2016
  8. Junio C HamanoSep 27, 2016
  9. Orgad ShanehSep 27, 2016
  10. Stefan BellerSep 27, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.