From: Jeff King Date: Fri, 16 Jun 2017 10:50:32 GMT Subject: Re: [PATCH] wt-status.c: Modified status message shown for a parent-less branch Message-ID: <20170616105032.rjmmql56ifol34mk@sigill.intra.peff.net> In-Reply-To: <1497609408.2517.4.camel@gmail.com> On Fri, Jun 16, 2017 at 04:06:48PM +0530, Kaartic Sivaraam wrote: > From what I could get from this thread, I guess the current patch > stands something like the one below. I tried building it with the below > change, it seems to be having a little issue. I'm not sure why, it > seems to be working the other way round i.e., the message "No commits > yet on the branch" message is shown in the commit template and the > message "Initial commit" is shown when `git status` is invoked. > > Also, let me know if any other change is required. > > diff --git a/builtin/commit.c b/builtin/commit.c > index 1d805f5da..3ed8e40bc 100644 > --- a/builtin/commit.c > +++ b/builtin/commit.c > @@ -1364,6 +1364,7 @@ int cmd_status(int argc, const char **argv, const > char *prefix) >                 usage_with_options(builtin_status_usage, > builtin_status_options); >   >         status_init_config(&s, git_status_config); > +       s.commit_template = 1; >         argc = parse_options(argc, argv, prefix, >                              builtin_status_options, >                              builtin_status_usage, 0); Wouldn't you want this in cmd_commit(), not cmd_status()? -Peff