git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Pratyush Yadav <me@yadavpratyush.com>
To: <git@vger.kernel.org>
Cc: "Martin Schön" <Martin.Schoen@loewensteinmedical.de>
Subject: [PATCH v2 0/2] git-gui: Use commit message template
Date: Fri, 27 Nov 2020 20:29:25 +0530	[thread overview]
Message-ID: <20201127145927.26222-1-me@yadavpratyush.com> (raw)

Hi,

This series is a revival of [0] which was pointed to me by [1]. I have
made some changes to the patch by Martin.

- The rescan call in proc commit_committree is removed. git-gui goes to
  great lengths to avoid a rescan after commit by calculating the status
  of the files in memory. It makes sense to keep it that way. The
  purpose of the rescan was to reload the commit template in the buffer
  after a commit. The rescan path handles that, but we can do that
  manually as well.

- Add a call to load the commit message template in 'rescan' directly
  instead of relying on 'run_prepare_commit_msg_hook' to do it when the
  commit-msg hook does not exist.

In addition, patch 1/2 fixes a small bug in the commit message buffer
backup logic that would be exposed by using the template mechanism. If
you load git-gui, do some things, and exit it. Then if you change the
commit message template (or even remove it), and open git-gui again it
will use the previous message for the first commit and then use the new
one from the next commit onwards.

This happens because if the commit message buffer in not empty, git-gui
saves the contents to save accidental loss of data. And when opening it
again, the saved message (which is the older template) obviously gets
priority.

[0] https://public-inbox.org/git/1530608011429.41203@loewensteinmedical.de/T/
[1] https://github.com/prati0100/git-gui/issues/24

Martin Schön (1):
  git-gui: use commit message template

Pratyush Yadav (1):
  git-gui: Only touch GITGUI_MSG when needed

 git-gui.sh     | 12 +++++++++---
 lib/commit.tcl |  1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

--
2.29.2


             reply	other threads:[~2020-11-27 15:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27 14:59 Pratyush Yadav [this message]
2020-11-27 14:59 ` [PATCH v2 1/2] git-gui: Only touch GITGUI_MSG when needed Pratyush Yadav
2020-11-27 14:59 ` [PATCH v2 2/2] git-gui: use commit message template Pratyush Yadav
2020-12-01 19:12 ` [PATCH v2 0/2] git-gui: Use " Pratyush Yadav

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=20201127145927.26222-1-me@yadavpratyush.com \
    --to=me@yadavpratyush.com \
    --cc=Martin.Schoen@loewensteinmedical.de \
    --cc=git@vger.kernel.org \
    /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).