All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pranit Bauva <pranit.bauva@zoho.com>
To: Eric Sunshine <sunshine@sunshineco.com>,
	Stefan Beller <sbeller@google.com>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: Git Mailing List <git@vger.kernel.org>, Jeff King <peff@peff.net>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Christian Couder <christian.couder@gmail.com>,
	Lars Schneider <larsxschneider@gmail.com>
Subject: Re: [PATCH/RFC] git-commit: add a commit.verbose config variable
Date: Fri, 26 Feb 2016 13:26:45 +0000	[thread overview]
Message-ID: <56D05295.6020102@zoho.com> (raw)
In-Reply-To: <CAPig+cQE6ytRKFjqRRLrPHCYqJuf52NKvy8sZs8rX3t5_kDRVg@mail.gmail.com>

Matthieu Moy:
> Using "git send-email" normally does the right thing. You may want to
> look at https://submitgit.herokuapp.com/ too.
git send-email does not work as my institute proxy does not allow
IMAP/SMTP connections. But I will take care of this from hence forward.

> The commit message should not try to rephrase what the patch aleady
> says.

I am dropping this statement off because of one another reason which
Eric Sunshine gave.

> If you know you haven't finished, you may use WIP (work in progress)
> instead of RFC in the title.

I wasn't familiar with this tag. I will keep it in mind. And this is not
included in Documentation/SubmittingPatches , so I will send a patch to
include WIP tag.

> "the git-config" is not proper English. You mean "a configuration file".
> I'd write "the configuration variable `commit.verbose` can be set to
> true".

I actually was facing problem in phrasing it. Thanks for your
suggestion. I will update this.

>> +	with git-config.
>
> Did you mean "git commit"?
Sorry for my carelessness. I will update this.


> Doesn't this override any value that --verbose or --no-verbose may >
 have set before?
Yes, this was the problem. I have fixed it now. But there is a glitch.
See below.

Eric Sunshine:
> On Thu, Feb 25, 2016 at 9:57 PM, Pranit Bauva <pranit.bauva@zoho.com> wrote:
>> From c273a02fc9cab9305cedf6e37422e257a1cc3b1e Mon Sep 17 00:00:00 2001
>> From: Pranit Bauva <pranit.bauva@zoho.com>
>> Date: Fri, 26 Feb 2016 07:14:18 +0530
>> Subject: [PATCH/RFC] git-commit: add a commit.verbose config variable

>From hence forth I will take that into consideration.

> Talking about this in the commit message misleads the reader into
> thinking that there is some potential oddity going on where a careful
> decision needs to be made about which variable to set, when that's not
> in fact the case. The 'verbose' member of wt_status is just one
> consumer of the "verbose" flag, not the sole consumer. Another
> consumer is found in builtin/commit.c:cmd_commit():
> 
>     if (verbose ||
>         cleanup_mode == CLEANUP_SCISSORS)
>             wt_status_truncate_message_at_cut_line(&sb);
> 
> So, it would not be correct for the configuration ever to set only
> wt_status::verbose.
> 
> Consequently, it would be better to drop this paragraph altogether
> from the commit message, so as to avoid confusing readers.

I guessed this parent-child behavior and I wanted the commit to sound
like that but now that I read it again, I can understand that it might
confuse readers who aren't familiar with the code base.

> Some tests to consider:
> 
> * commit.verbose unset

This was working perfectly fine!

> * commit.verbose=true

This was working perfectly fine!

> * commit.verbose=false

This was working perfectly fine!

> * --verbose overrides commit.verbose

This was showing errors. So I now included an if statement and then
placed the whole code after the method parse_and_validate_options()
otherwise it would just ignore the behavior. Now even this is working
perfectly fine.

> * --no-verbose overrides commit.verbose

This is a problematic one as currently `git-commit` does not have such a
behavior. I tried printing value of `verbose` in both the cases ie. with
`git commit` and `git commit --no-verbose` and in both of them it
printed the value 0. So currently, the program won't understand the
"overriding" nature. I have an idea for implementing this. We can keep
the default nature to point out to 0 and `--no-verbose` to point to -1.
But I guess this problem would have been faced/implemented in other part
of the code. I will have to look in different parts of code and see how
this has been done in those so as to maintain the practices followed
with git. I am currently not quite familiar with `parse-options.c` so I
will read about it. But you could help by pointing out specific commits
or email threads which are related to `--no-verbose` option in other git
commands to speed up the process.

> I haven't fully digested builtin/commit.c, but the placement of this
> new code seems suspect. My expectation would have been to see
> git_commit_config() updated to recognize the new "commit.verbose"
> variable. Am I missing something?

I too had a lot of confusing regarding this. But it seems to me that the
method git_commit_config() shows a "different" behavior and I don't
think such "complicated" behavior is required for reading the boolean
variable `commit.verbose`.

  reply	other threads:[~2016-02-26  7:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  2:57 [PATCH/RFC] git-commit: add a commit.verbose config variable Pranit Bauva
2016-02-25 21:27 ` Matthieu Moy
2016-02-25 21:58   ` Stefan Beller
2016-02-26  3:00 ` Eric Sunshine
2016-02-26 13:26   ` Pranit Bauva [this message]
2016-02-26 16:56     ` Junio C Hamano
2016-02-26 17:32       ` Matthieu Moy

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56D05295.6020102@zoho.com \
    --to=pranit.bauva@zoho.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=larsxschneider@gmail.com \
    --cc=peff@peff.net \
    --cc=sbeller@google.com \
    --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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.