From: Thomas Rast <trast@student.ethz.ch>
To: <git@vger.kernel.org>
Cc: Ron Garret <ron1@flownet.com>,
Avery Pennarun <apenwarr@gmail.com>,
Pete Harlan <pgit@pcharlan.com>
Subject: [PATCH] Documentation: clarify git-mv behaviour wrt dirty files
Date: Wed, 3 Feb 2010 22:12:12 +0100 [thread overview]
Message-ID: <c43166fa73391a40b43c27153ec142121fdb71d1.1265231310.git.trast@student.ethz.ch> (raw)
In-Reply-To: <ron1-A681F2.12340503022010@news.gmane.org>
Clearly point out that the rename happens separately for worktree and
index. This confused users, as they are apparently told that git-mv
== git-rm && mv && git-add, which it is not.
While there, move the synposis to the synopsis section, which so far
was rather useless, and reword the first sentence to eliminate the
mentions of 'script'.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
Ron, please don't drop the Cc lists, it's customary around here to Cc
everyone involved so far.
On Wednesday 03 February 2010 21:34:05 you wrote:
> In article <4B69D897.2060908@pcharlan.com>,
> Pete Harlan <pgit@pcharlan.com> wrote:
> > Unlike "git rm", "git mv" could still perform the operation even without
> > "-f", but the semantics of "git mv" differ enough from plain "mv" that a
> > short blurb from Git in that case might help.
>
> I think that a simple tweak to the docs would be enough. Right now it
> says:
>
> "The index is updated after successful completion, but the change must
> still be committed."
>
> I'm pretty sure I would have been less confused if it had said something
> like:
>
> "The index is updated to reflect the new name of the file, but NOT any
> new content that file may contain. Changed content must be added to the
> index separately with git add, and all changes must still be commited."
How about this change instead, which formulates it in terms of what
does happen, instead of what does not.
BTW, I'm wondering whether the "move or rename" distinction is really
worth it. Does the user care? I always figured it was a technical
detail whether rename() works or you actually need to move anything.
Documentation/git-mv.txt | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Documentation/git-mv.txt b/Documentation/git-mv.txt
index bdcb585..eff11b7 100644
--- a/Documentation/git-mv.txt
+++ b/Documentation/git-mv.txt
@@ -8,22 +8,22 @@ git-mv - Move or rename a file, a directory, or a symlink
SYNOPSIS
--------
-'git mv' <options>... <args>...
+'git mv' [-f] [-n] <source> <destination>
+'git mv' [-f] [-n] [-k] <source>... <destination directory>
DESCRIPTION
-----------
-This script is used to move or rename a file, directory or symlink.
-
- git mv [-f] [-n] <source> <destination>
- git mv [-f] [-n] [-k] <source> ... <destination directory>
+'git-mv' renames files, directories, and symlinks in worktree and
+index.
In the first form, it renames <source>, which must exist and be either
a file, symlink or directory, to <destination>.
In the second form, the last argument has to be an existing
directory; the given sources will be moved into this directory.
-The index is updated after successful completion, but the change must still be
-committed.
+For every renamed file or symlink, the worktree and index contents are
+renamed separately, preserving both staged and unstaged changes. You
+will still have to commit the rename.
OPTIONS
-------
--
1.7.0.rc1.166.g7cae7
next prev parent reply other threads:[~2010-02-03 21:12 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-03 18:25 git-mv redux: there must be something else going on Ron Garret
2010-02-03 18:48 ` Avery Pennarun
2010-02-03 19:23 ` Ron Garret
2010-02-03 19:47 ` Avery Pennarun
2010-02-03 20:30 ` Ron Garret
2010-02-03 19:53 ` Nicolas Pitre
2010-02-03 20:27 ` Ron Garret
2010-02-03 20:31 ` Ron Garret
2010-02-03 20:40 ` Avery Pennarun
2010-02-03 22:33 ` Ron Garret
2010-02-03 23:18 ` Avery Pennarun
2010-02-03 23:55 ` Jay Soffian
2010-02-04 0:10 ` Ron Garret
2010-02-04 0:10 ` Ron Garret
2010-02-04 0:48 ` Junio C Hamano
2010-02-03 20:44 ` Nicolas Pitre
2010-02-03 20:12 ` Pete Harlan
2010-02-03 20:34 ` Ron Garret
2010-02-03 21:12 ` Thomas Rast [this message]
2010-02-03 21:56 ` [PATCH] Documentation: clarify git-mv behaviour wrt dirty files 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=c43166fa73391a40b43c27153ec142121fdb71d1.1265231310.git.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=pgit@pcharlan.com \
--cc=ron1@flownet.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 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).