git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Faulkner <natedogith1@gmail.com>
To: Ed Avis <ed.avis@qmaw.com>, Junio C Hamano <gitster@pobox.com>,
	Philip Oakley <philipoakley@iee.email>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git log --name-only improvement: show old file name in rename
Date: Thu, 16 May 2024 19:13:34 -0400	[thread overview]
Message-ID: <c239ab15-4d48-4328-8bd5-8e2d77163e03@gmail.com> (raw)
In-Reply-To: <BL0PR11MB34608AE271344D508676D17A9D9C0@BL0PR11MB3460.namprd11.prod.outlook.com>

The documentation for --name-only says "Show only names of changed 
files." I would interpret this to mean "output the names of all files 
that changed", not "output the names of all files that changed, unless 
git detected it as renamed".  --no-renames makes it behave as expected, 
but having to specify it isn't obvious.  A warning in the documentation 
could help, but --no-renames should probably be included by default when 
--name-only is specified.

I ran into an issue today with code that expected git diff --name-only 
to output all changed files.  A file was created and an unrelated file 
was deleted in the same commit, but they happened to be similar enough 
that git detected it as rename, and thus git diff --name-only indicated 
only one file changed when two files were actually changed.


  reply	other threads:[~2024-05-16 23:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-11 11:19 git log --name-only improvement: show old file name in rename Ed Avis
2020-06-11 23:16 ` Junio C Hamano
2020-06-12 14:18   ` Philip Oakley
2020-06-12 17:03     ` Junio C Hamano
2020-06-15  7:36       ` Ed Avis
2024-05-16 23:13         ` Nathan Faulkner [this message]
2024-05-17 16:00           ` Re*: " Junio C Hamano
2024-05-18  0:24             ` Nathan Faulkner
2024-05-18  2:05               ` 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=c239ab15-4d48-4328-8bd5-8e2d77163e03@gmail.com \
    --to=natedogith1@gmail.com \
    --cc=ed.avis@qmaw.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=philipoakley@iee.email \
    /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).