From: Pratyush Yadav <me@yadavpratyush.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Johannes Sixt <j6t@kdbg.org>, Git List <git@vger.kernel.org>
Subject: Re: [PATCH] git-gui: remove lines starting with the comment character
Date: Thu, 4 Feb 2021 02:09:47 +0530 [thread overview]
Message-ID: <20210203203947.j2ut5p7nhrd6rcmh@yadavpratyush.com> (raw)
In-Reply-To: <CAPig+cTQaPTNnGcd583B=xoVUR1qPb372Y_x9szROfMcA5h+tA@mail.gmail.com>
On 03/02/21 12:48PM, Eric Sunshine wrote:
> On Wed, Feb 3, 2021 at 12:35 PM Johannes Sixt <j6t@kdbg.org> wrote:
> > Am 02.02.21 um 21:03 schrieb Pratyush Yadav:
> > > The comment character is specified by the config variable
> > > 'core.commentchar'. Any lines starting with this character is considered
> > > a comment and should not be included in the final commit message.
> > >
> > > Teach git-gui to filter out lines in the commit message that start with
> > > the comment character. If the config is not set, '#' is taken as the
> > > default.
> >
> > This is WRONG. Git GUI is that: a GUI, it's all about WYSIWYG. If you do
> > not give sufficient unambiguous visual clue to the user that certain
> > lines will be ignored, you cannot ignore them.
> >
> > Perhaps what you are really only interested in is to remove the list of
> > conflicted files after a merge conflict? Then the correct way to proceed
> > would be to sanitize the contents of .git/MERGE_MSG before it is
> > inserted into the edit box.
While this patch also fixes the merge conflict message case, it was in
fact prompted by [0], which talks about comments in the commit message
template. This is likely useful information that we don't want to hide
from the user.
>
> This is indeed the case I run into which is annoying because the
> commented-out list of conflicted files does not get removed when
> git-gui performs the actual commit.
>
> However, although what you propose here seems superficially enticing,
> it doesn't mirror the behavior of git-commit itself when launching an
> editor, in which case the unsanitized file (containing the
> commented-out conflicted file list) is loaded into the editor
> verbatim, and it is only sanitized when the edit session is finished.
> The important difference is that extra text is added to the edit
> buffer telling the user explicitly that "lines beginning with '#' will
> be ignored".
I agree.
> So, perhaps one way forward is for Pratyush to emulate that behavior
> and insert some text into the edit box saying "lines beginning with
> '#' will be ignored", or add a label above or below the edit box
> stating the same. (Of course, the actual displayed comment-character
> should be determined dynamically.)
This would be a nice addition. Will see which approach looks best.
[0] https://github.com/prati0100/git-gui/issues/51
--
Regards,
Pratyush Yadav
prev parent reply other threads:[~2021-02-03 20:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-02 20:03 [PATCH] git-gui: remove lines starting with the comment character Pratyush Yadav
2021-02-02 22:26 ` Eric Sunshine
2021-02-03 11:54 ` Pratyush Yadav
2021-02-03 17:33 ` Johannes Sixt
2021-02-03 17:48 ` Eric Sunshine
2021-02-03 17:58 ` Eric Sunshine
2021-02-03 21:42 ` Johannes Sixt
2021-02-03 20:39 ` Pratyush Yadav [this message]
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=20210203203947.j2ut5p7nhrd6rcmh@yadavpratyush.com \
--to=me@yadavpratyush.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=sunshine@sunshineco.com \
/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).