All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen & Linda Smith <ischis2@cox.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: Re: Bug report: 'git commit --dry-run' corner case: returns error  ("nothing to commit") when all conflicts resolved to HEAD
Date: Thu, 11 Feb 2016 18:04:03 -0700	[thread overview]
Message-ID: <2471685.OJU1dNe0yn@thunderbird> (raw)
In-Reply-To: 1649296.sC1eN3ni6k@thunderbird

On Monday, February 08, 2016 06:55:17 PM Stephen & Linda Smith wrote:
> > #!/bin/bash
> > mkdir test-repository || exit 1
> > cd test-repository
> > git init
> > echo "Initial contents, unimportant" > test-file
> > git add test-file
> > git commit -m "Initial commit"
> > echo "commit-1-state" > test-file
> > git commit -m "commit 1" -i test-file
> > git tag commit-1
> > git checkout -b branch-2 HEAD^1
> > echo "commit-2-state" > test-file
> > git commit -m "commit 2" -i test-file
> > 
> > # Creates conflicted state.
> > git merge --no-commit commit-1
> > 
> > # Resolved entirely to commit-2, aka HEAD.
> > echo "commit-2-state" > test-file
> > # If we'd set to commit-1=state, all would work as expected (changes vs HEAD).
> > git add test-file
> > 
> > # =====  Bug is here.
> > git commit --dry-run && echo "Git said something to commit" \
> >         || echo "Git said NOTHING to commit"

With the  '--dry-run' switch, dry_run_commit() is called which returns 1 
since run_status() is returning the wt_status commitable field which has a value of 0.

That field is only set in one place (wt_status_print_updated) which isn't getting called
directly or indirectly by run_status.   I checked this by code inspection as well as by 
instrumenting the code.

I'm not sure that we want to add a call to wt_status_print_updated in run_status since 
I don't believe we want the print statements.   An alternative might be to create a
new function.

> > 
> > git commit -m "Something to commit after all" && echo "Commit went through"
> > 
> > git log --pretty=oneline

  parent reply	other threads:[~2016-02-12  1:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1649296.sC1eN3ni6k@thunderbird>
2016-02-09  1:55 ` Bug report: 'git commit --dry-run' corner case: returns error ("nothing to commit") when all conflicts resolved to HEAD Stephen & Linda Smith
2016-02-16  2:38   ` [PATCH] wt-status.c: set commitable bit if there is a meaningful merge Stephen P. Smith
2016-02-16  8:20     ` Philip Oakley
2016-02-16 21:54       ` Junio C Hamano
2016-02-16 23:26       ` Stephen & Linda Smith
2016-02-16 23:40       ` Stephen & Linda Smith
2016-02-16 23:30     ` Stephen & Linda Smith
2016-02-17  3:33     ` Junio C Hamano
2016-02-17  5:06       ` [PATCH v2] " Stephen P. Smith
2016-02-17  4:58     ` [PATCH] " Stephen & Linda Smith
2016-05-10  4:51     ` Stephen & Linda Smith
2018-08-22  5:33     ` Stephen Smith
2018-08-22 15:39       ` Junio C Hamano
2018-08-22 15:54       ` Junio C Hamano
2018-08-23  1:28       ` Stephen & Linda Smith
2016-02-12  1:04 ` Stephen & Linda Smith [this message]
2015-08-26  2:21 Bug report: 'git commit --dry-run' corner case: returns error ("nothing to commit") when all conflicts resolved to HEAD Ovidiu Gheorghioiu

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=2471685.OJU1dNe0yn@thunderbird \
    --to=ischis2@cox.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.