git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 'git pull --dry-run' accepted, but moves HEAD and changes working tree
@ 2010-05-24 13:58 Jeff Epler
  2010-05-25  6:07 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Epler @ 2010-05-24 13:58 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-26  5:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-24 13:58 'git pull --dry-run' accepted, but moves HEAD and changes working tree Jeff Epler
2010-05-25  6:07 ` Jeff King
2010-05-26  5:07   ` Junio C Hamano

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).