git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Using "git log" to find the files patched at the same time as a named file

From
Zack Brown <zacharyb@gmail.com>
Date
Feb 3, 2010, 21:52 UTC
Message-ID
<218b69371002031352je066f5cvd87025459fade368@mail.gmail.com>
In-Reply-To
<7vfx5idmt2.fsf@alter.siamese.dyndns.org>

That looks much clearer. But I would change the final sentence to, "This option lifts that limit and tells "git log" to include changes from all paths that were affected by the outputted commits, not just the changes from the paths specified on the command line."

Be well, Zack

On Wed, Feb 3, 2010 at 4:36 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 57 quoted lines
> Zack Brown <zacharyb@gmail.com> writes:
>
>> ... What about something like this:
>>
>> "Without this flag, "git log -p <path>..." shows commits that touch
>> the specified paths, but it only includes the diffs from those commits
>
> I would say "s/but/and/", because it is more natural that you get the
> "limited" view after you explicitly stated that you are "only interested
> in these things" by giving pathspecs.
>
>> that affected those specified paths, regardless of whether other paths
>> were changed in those same commits. With "git log --full-diff -p
>> <path>...", git still only reports commits that touch the specified
>> path, but now it also includes the diffs that affected any other paths
>> changed in those same commits."
>
> And "but" on the second line from the bottom makes sense---by giving the
> option, you are telling it to work differently.
>
>> Would that be an improvement?
>
> Surely.  I would suspect that people would go even further.  "-p" is not
> very special (notice I used --name-status in my example).
>
> Also I think the description should start with what it _does_, not with
> what happens without it.
>
> So how about this?
>
> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
> index 0e39bb6..5dd1c0c 100644
> --- a/Documentation/git-log.txt
> +++ b/Documentation/git-log.txt
> @@ -49,11 +49,14 @@ include::diff-options.txt[]
>        commit was reached.
>
>  --full-diff::
> -       Without this flag, "git log -p <path>..." shows commits that
> -       touch the specified paths, and diffs about the same specified
> -       paths.  With this, the full diff is shown for commits that touch
> -       the specified paths; this means that "<path>..." limits only
> -       commits, and doesn't limit diff for those commits.
> +       Show all changes, even outside the given pathspecs.
> ++
> +Pathspecs <path>... given to "git log [<options>] <path>..."  limit the
> +output to the commits that touch the specified paths.  When options to
> +show changes introduced by these commits (e.g. "-p", "--name-only") are
> +given, the output of the changes are also limited to the specified paths.
> +This option lifts the latter limit and tells "git log" to include all
> +changes, even the ones outside of the given pathspecs.
>
>  --follow::
>        Continue listing the history of a file beyond renames.
>
>
>
-- 
Zack Brown
Previous: Junio C Hamano
Message 5 of 5 in “Using "git log" to find the files patched at the same time as a named file”
  1. Zack BrownFeb 3, 2010
  2. Junio C HamanoFeb 3, 2010
  3. Zack BrownFeb 3, 2010
  4. Junio C HamanoFeb 3, 2010
  5. Zack BrownFeb 3, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.