From: Jeff Epler <jepler@unpythonic.net>
To: git@vger.kernel.org
Subject: 'git pull --dry-run' accepted, but moves HEAD and changes working tree
Date: Mon, 24 May 2010 08:58:23 -0500 [thread overview]
Message-ID: <20100524135823.GC19861@unpythonic.net> (raw)
I don't recall why I initially typed it, I was surprised to discover
that 'git pull --dry-run' moves HEAD and modifies the working tree.
Here's an example:
$ git reset --hard HEAD^ # so there's something on origin to merge
HEAD is now at c26a08d fix clearing of mesa components
$ git rev-parse HEAD; git pull --dry-run; git rev-parse HEAD
c26a08d1535a02ec044efd0d1fa50205d2da03fa
Updating c26a08d..41c8ee3
Fast-forward
docs/man/man9/hostmot2.9 | 7 +++++--
src/hal/drivers/mesa-hostmot2/stepgen.c | 5 +++++
2 files changed, 10 insertions(+), 2 deletions(-)
41c8ee3e19ffb13cc357375d87940cac4769e029
$ git --version
git version 1.7.1
On IRC, jast points out that 'git pull --dry-run' is not explicitly
documented, but unfortunately it is accepted and then does something
that is really counter to the user's expectations. (I assume it's
passing --dry-run to fetch, which does accept it, but that doesn't
ensure that there's nothing at all to merge)
Maybe 'git pull --dry-run' should just be forbidden, or maybe it could
tell the user whether the result of the pull would be a merge, FF, or no
change.
Jeff
next reply other threads:[~2010-05-24 13:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-24 13:58 Jeff Epler [this message]
2010-05-25 6:07 ` 'git pull --dry-run' accepted, but moves HEAD and changes working tree Jeff King
2010-05-26 5:07 ` Junio C Hamano
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=20100524135823.GC19861@unpythonic.net \
--to=jepler@unpythonic.net \
--cc=git@vger.kernel.org \
/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 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 NNTP newsgroup(s).