git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Cc: gitster@pobox.com, peff@peff.net, git@vger.kernel.org
Subject: Re: [PATCH 1/3] Contextually notify user about an initial commit
Date: Tue, 20 Jun 2017 16:41:46 +0200	[thread overview]
Message-ID: <87mv9290wl.fsf@gmail.com> (raw)
In-Reply-To: <1497965839.2792.2.camel@gmail.com>


On Tue, Jun 20 2017, Kaartic Sivaraam jotted:

> Thanks for trying to help. A few comments regarding your suggestions.
>
>> * Let's do that spacing fix (unrelated fix) in its own commit.
>>
> Ok. That's a good point.
>
>> * You should add tests along with the code being changed, and
>> especially change tests that would fail with your new code,
>>     otherwise you break bisection.
>>
> I'm not sure if the convention here is to keep tests along with change
> it tests. I thought it would be better to separate them as they are
> "separate" changes. They're separate because in case of any issues with
> the test it should be possible to identify them separately. This isn't
> possible when they are added along with the change.
>
> Further, adding them as a separate change change (commit) immediately
> after the change it tests would ease the task of finding the change it
> tests.
>
> If the convention here, really, is to add tests along with the
> change,I can't do anything but to follow it. I guess it should be
> mentioned somewhere in the Documentation/SubmittingPatches. AFAIK, I
> don't think it's mentioned there.

Right now 1/3 breaks the test suite. That's a big no-no, any given
commit should not break the test suite to not break bisecting.

But aside from that the general pattern we follow is that if code
behavior changes, tests for that new behavior go in the same commit.

>> * I think the commit message here could be shorter & clearer at the
>> same time.
> I don't think it's unclear. It's longer for the reason that follows.
> The commit message was crafted based on the following guideline found
> in Documentation/SubmittingPatches
>
>> The body should provide a meaningful commit message, which:
>>
>>  . explains the problem the change tries to solve, i.e. what is
>>     wrong with the current code without the change.
>>
>>  . justifies the way the change solves the problem, i.e. why the
>> result with the change is better.
>>
>>  . alternate solutions considered but discarded, if any.
>>
> I don't think the new commit message follows this. Both the commit
> messages are found below for comparison.
>
> Old one
> -------
>> On Tue, Jun 20 2017, Kaartic Sivaraam jotted:
>>
>>  "git status" indicated "Initial commit" when HEAD points at
>>  an unborn branch.This message is shared with the commit
>>  log template "git commit" prepares for the user when
>>  creating a commit (i.e. "You are about to create the initial
>>  commit"), and is OK as long as the reader is aware of the
>>  nature of the message (i.e. it guides the user working
>>  toward the next commit), but was confusing to new users,
>>  especially the ones who do "git commit -m message" without
>>  having a chance to pay attention to the commit log template.
>>
>>  The "Initial commit" indication wasn't an issue in the commit
>>  template. Taking that into consideration, a good solution would
>>  be to contextually use different messages to indicate the user
>>  that there were no commits in this branch.
>>
>>  A few alternatives considered were,
>>
>>  * Waiting for initial commit
>>  * Your current branch does not have any commits
>>  * Current branch waiting for initial commit
>>
>>  The most succint one, "No commits yet", among the alternatives
>>  was chosen.
>>
>>  Helped-by: Junio C Hamano <gitster@pobox.com>
>>  Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
>>
>
> New one
> -------
>>  status: contextually notify user about an initial commit
>>
>> Change the output of "status" to say "No commits yet" when "git
>>  retaining the current "Initial commit" message displayed in the
>>  template that's displayed in the editor when the initial commit is
>>  being authored.
>>
>> The existing "Initial commit" message makes sense for the commit
>> template where we're making the initial commit, but is confusing
>>  when merely checking the status of a fresh repository without
>>  having any commits yet.
>>
>> Helped-by: Junio C Hamano <gitster@pobox.com>
>> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>>
>
>> * The commit message doesn't follow our usual format.
> Could you be more specific about where it's not following the format?

Regarding the format: I was referring to the 'prefix the first line with
"area: "' part of SubmittingPatches, sorry for the brevity. I.e. your
--oneline output just yields "Contextually notify user about an initial
commit" but should be "status: <short summary>".

For the rest of the changes I made: I just found the current version
hard to read, most of the first paragraph is one big 8-line sentence,
after reading it over a few times and understanding what it was doing I
thought I'd rewrite it as a shorter version that was (hopefully) easier
to understand.

I dropped the "alternatives considered" because while it follows the
SubmittingPatches guidelines as-is, given other patches I've seen what
we eventually ended up picking for some trivial wording in a UI message
is probably better left to a mailing list search for anyone's that
curious rather than summarizing all the proposed alternatives in the
commit message.

  reply	other threads:[~2017-06-20 14:41 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-10  1:52 [PATCH] wt-status.c: Modified status message shown for a parent-less branch Kaartic Sivaraam
2017-06-10  2:10 ` Kaartic Sivaraam
2017-06-10  2:23 ` Junio C Hamano
2017-06-10  8:44   ` Kaartic Sivaraam
2017-06-10  9:36     ` Kaartic Sivaraam
2017-06-10 10:21     ` Jeff King
2017-06-10 11:02       ` Junio C Hamano
2017-06-12  8:10         ` Kaartic Sivaraam
2017-06-12 18:28           ` Junio C Hamano
2017-06-12 21:20             ` Jeff King
2017-06-12 21:31               ` Junio C Hamano
2017-06-12 21:37                 ` Jeff King
2017-06-15  8:19                   ` Kaartic Sivaraam
2017-06-15  8:42                     ` Jeff King
2017-06-15 11:43                       ` Samuel Lijin
2017-06-15 13:12                         ` Jeff King
2017-06-16 10:36                           ` Kaartic Sivaraam
2017-06-16 10:50                             ` Jeff King
2017-06-18  7:35                               ` [PATCH/Almost final] " Kaartic Sivaraam
2017-06-18  7:53                                 ` [PATCH/ALMOST FINAL] Contextually notify user about an initial commit Kaartic Sivaraam
2017-06-18  8:34                                   ` Ævar Arnfjörð Bjarmason
2017-06-19  2:41                                     ` [PATCH 1/2] " Kaartic Sivaraam
2017-06-19  2:44                                       ` [PATCH 2/2] Add test for the new status message Kaartic Sivaraam
2017-06-19  4:32                                         ` Junio C Hamano
2017-06-19 17:59                                           ` Kaartic Sivaraam
2017-06-19 18:04                                             ` Jeff King
2017-06-19 18:33                                               ` Kaartic Sivaraam
2017-06-19  4:29                                       ` [PATCH 1/2] Contextually notify user about an initial commit Junio C Hamano
2017-06-19  2:41                                     ` [PATCH 2/2] Add test for the new status message Kaartic Sivaraam
2017-06-19  9:10                                     ` [PATCH/ALMOST FINAL] Contextually notify user about an initial commit Jeff King
2017-06-19 13:24                                       ` Kaartic Sivaraam
2017-06-19 15:47                                       ` Junio C Hamano
2017-06-20  3:02                                         ` [PATCH 1/3] " Kaartic Sivaraam
2017-06-20  3:02                                           ` [PATCH 2/3] Update test(s) that used old status message Kaartic Sivaraam
2017-06-20  3:02                                           ` [PATCH 3/3] Add tests for the contextual initial " Kaartic Sivaraam
2017-06-20  7:26                                           ` [PATCH 1/3] Contextually notify user about an initial commit Ævar Arnfjörð Bjarmason
2017-06-20 13:37                                             ` Kaartic Sivaraam
2017-06-20 14:41                                               ` Ævar Arnfjörð Bjarmason [this message]
2017-06-21  2:34                                                 ` Kaartic Sivaraam
2017-06-21  2:37                                                   ` [PATCH/FINAL] status: contextually " Kaartic Sivaraam
2017-06-21 14:35                                                     ` Kaartic Sivaraam
2017-06-21 14:52                                                       ` Ævar Arnfjörð Bjarmason
2017-06-21 17:45                                                         ` Kaartic Sivaraam
2017-06-21 18:45                                                           ` Junio C Hamano
2017-06-21 18:16                                                         ` Kaartic Sivaraam
2017-06-22  2:10                                                           ` Junio C Hamano
2017-06-22  3:01                                                             ` Kaartic Sivaraam
2017-06-10 14:44     ` [PATCH] wt-status.c: Modified status message shown for a parent-less branch Philip Oakley

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=87mv9290wl.fsf@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kaarticsivaraam91196@gmail.com \
    --cc=peff@peff.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).