git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] wt-status.c: set commitable bit if there is a meaningful merge.

From
SSStephen & Linda Smith <ischis2@cox.net>
Date
Feb 16, 2016, 23:40 UTC
Message-ID
<3639645.80CNmLM0I7@thunderbird>
In-Reply-To
<C8BDC3289C184F40BFBE3B150CFBB50B@PhilipOakley>
On Tuesday, February 16, 2016 04:26:38 PM Stephen & Linda Smith wrote:
Show 24 quoted lines
> On Tuesday, February 16, 2016 01:54:48 PM Junio C Hamano wrote:
> > "Philip Oakley" <philipoakley@iee.org> writes:
> > 
> > >>    It appeared that the conditional for 'Reject an attempt to record a
> > >>    non-merge empty commit without * explicit --allow-empty.' could be
> > >>    simplified after adding this patch.
> > >>
> > >>    This change can't be propagated to the conditional because it allows
> > >>    a commit that was previously disallowed.
> > 
> > This last sentence sounds somewhat worrysome.  Does that mean some
> > commit that was previously disallowed (which ones?) is still
> > forbidden by "commit" without "--dry-run" (which is correct--we are
> > not interested in changing the behaviour of the main codepath), but
> > "--dry-run", even with this update, will say "OK you will make a
> > meaningful commit" by exiting with 0 for such disallowed commit?
> I tried to think of a better set of wording.  Finally I decided to make it part of the note 
> rather than the commit message so that it could be debated as part of the review 
> but not be part of the commit record for the line being changed.
> 
> The patch doesn't change behaviour other than the dry-run return code 
> which now matches the return code of commit.  The one line change is not changing the
> main code path behaviour
> 

I am not adverse to moving the change to dry_run_commit() proper, but that would mean a slightly larger patch.

Show 15 quoted lines
> The main code path for the case being fixed executes through the main code path 
> successfully returning zero.  The ''--dry-run' was predicitng failure if a script was 
> checking the return code, but successs if looking at the messages.
> 
> The final couple of paragraphs explain why I chose not to change the if() statement. 
> The reason I didn't is so that expected behaviour is maintained.
> 
> The condition that can not be removed in the if is the 'whence != FROM_MERGE'.   Removing 
> that caused t7502 to generate errors.   Therefore I left ' if (!commitable && whence != FROM_MERGE 
> && !allow_empty &&  !(amend && is_a_merge(current_head)))' in the commit.c file.
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Stephen & Linda SmithNext: Stephen & Linda Smith
Message 6 of 16 in “Re: Bug report: 'git commit --dry-run' corner case: returns error ("nothing to commit") when all conflicts resolved to HEAD”
  1. Stephen & Linda SmithFeb 9, 2016
  2. wt-status.c: set commitable bit if there is a meaningful merge.Stephen P. Smith, Feb 16, 2016
  3. Philip OakleyFeb 16, 2016
  4. Junio C HamanoFeb 16, 2016
  5. Stephen & Linda SmithFeb 16, 2016
  6. Stephen & Linda SmithFeb 16, 2016
  7. Stephen & Linda SmithFeb 16, 2016
  8. Junio C HamanoFeb 17, 2016
  9. wt-status.c: set commitable bit if there is a meaningful merge.Stephen P. Smith, Feb 17, 2016
  10. Stephen & Linda SmithFeb 17, 2016
  11. Stephen & Linda SmithMay 10, 2016
  12. Stephen SmithAug 22, 2018
  13. Junio C HamanoAug 22, 2018
  14. Junio C HamanoAug 22, 2018
  15. Stephen & Linda SmithAug 23, 2018
  16. Stephen & Linda SmithFeb 12, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.