Files
git/Documentation
Junio C Hamano 4986662cbc diff: document what --name-only shows
The "--name-only" option is about showing the name of each file in
the post-image tree that got changed and nothing else (like "was it
created?").  Unlike the "--name-status" option that tells how the
change happened (e.g., renamed with similarity), it does not give
anything else, like the name of the corresponding file in the old
tree.

For example, if you start from a clean checkout that has a file
whose name is COPYING, here is what you would see:

    $ git mv COPYING RENAMING
    $ git diff -M --name-only HEAD
    RENAMING
    $ git diff -M --name-status HEAD
    R100	COPYING	RENAMING

Lack of the description of this fact has confused readers in the
past.  Even back when dda2d79a ([PATCH] Clean up diff option
descriptions., 2005-07-13) documented "--name-only", "git diff"
already supported the renames, so in a sense, from day one, this
should have been documented more clearly but it wasn't.

Belatedly clarify it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-05-17 11:03:08 -07:00
..
2024-04-19 12:38:38 +02:00
2023-02-15 17:11:52 -08:00
2022-10-30 21:04:44 -04:00
2023-01-05 14:52:25 +09:00
2023-02-18 09:29:13 -08:00
2022-10-25 15:44:18 -07:00
2022-02-02 14:50:09 -08:00
2021-09-28 10:31:02 -07:00
2021-12-10 14:35:03 -08:00
2024-04-19 12:38:37 +02:00
2019-05-07 13:04:48 +09:00
2022-11-30 10:57:19 +09:00
2019-10-21 12:02:39 +09:00