public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel•com>
To: Ben Knoble <ben.knoble@gmail•com>
Cc: <git@vger•kernel.org>, Junio C Hamano <gitster@pobox•com>,
	Jacob Keller <jacob.keller@gmail•com>
Subject: Re: [PATCH v4 3/3] diff --no-index: support limiting by pathspec
Date: Wed, 4 Jun 2025 10:22:37 -0700	[thread overview]
Message-ID: <a5bc1851-e80b-4795-8aaf-46984b0cdfb8@intel.com> (raw)
In-Reply-To: <374BC043-8FB8-4052-BDE7-6BAE7F182994@gmail.com>



On 6/3/2025 7:37 PM, Ben Knoble wrote:
> Actually, one comment :)
> 
>> Le 21 mai 2025 à 19:29, Jacob Keller <jacob.e.keller@intel•com> a écrit :
>>
>> From: Jacob Keller <jacob.keller@gmail•com>
>>
>> The --no-index option of git-diff enables using the diff machinery from
>> git while operating outside of a repository. This mode of git diff is
>> able to compare directories and produce a diff of their contents.
>>
>> When operating git diff in a repository, git has the notion of
>> "pathspecs" which can specify which files to compare. In particular,
>> when using git to diff two trees, you might invoke:
>>
>> $ git diff-tree -r <treeish1> <treeish2>.
> 
> I do find it slightly confusing that this series and in particular this patch is all about git-diff(1), but the only example is about git-diff-tree(1). It’s not the best example to me, esp. since it doesn’t actually use the pathspec machinery (deferring that to prose only). But I get the gist, so not really an issue.
> 

Fair point. I think my brain wires got crossed as I was thinking of git
diff-tree as an example for why pathspecs always come at the end.

> Rereading a bit, it seems this message goes to lengths to teach readers about pathspecs for git-diff here; perhaps we can simplify those parts and assume the reader is familiar enough with the details to understand the implications of « no-index mode doesn’t support pathspecs to limit comparison »?
> 

Yea, we could probably simplify this. I usually try to be verbose with
my "this is the reasoning for why to do this" and give background.. but
that can sometimes end up being too much.

Regardless, the example probably should use pathspecs if we keep it..

> Nit: Should the diff-tree command end with a period?
> 

It should not.

  reply	other threads:[~2025-06-04 17:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-21 23:29 [PATCH v4 0/3] diff: add pathspec support to --no-index Jacob Keller
2025-05-21 23:29 ` [PATCH v4 1/3] pathspec: add match_leading_pathspec variant Jacob Keller
2025-05-21 23:29 ` [PATCH v4 2/3] pathspec: add flag to indicate operation without repository Jacob Keller
2025-05-21 23:29 ` [PATCH v4 3/3] diff --no-index: support limiting by pathspec Jacob Keller
2025-06-04  2:37   ` Ben Knoble
2025-06-04 17:22     ` Jacob Keller [this message]
2025-06-04 18:27     ` Jacob Keller
2025-06-04 20:19       ` Junio C Hamano
2025-06-04 21:05         ` Jacob Keller
2025-06-04 21:36           ` D. Ben Knoble
2025-06-04 23:22             ` Junio C Hamano
2025-09-23 14:57   ` Johannes Schindelin
2025-09-23 22:48     ` Jacob Keller
2025-09-24 11:19       ` Johannes Schindelin
2025-09-24 18:19         ` Jacob Keller
2025-09-24 18:23           ` Jacob Keller
2025-05-22 21:37 ` [PATCH v4 0/3] diff: add pathspec support to --no-index Junio C Hamano
2025-05-22 21:50   ` Jacob Keller
2025-05-22 22:04     ` Junio C Hamano
2025-06-03 21:12 ` Junio C Hamano
2025-06-04  2:32   ` Ben Knoble
2025-06-05 15:34   ` Phillip Wood

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=a5bc1851-e80b-4795-8aaf-46984b0cdfb8@intel.com \
    --to=jacob.e.keller@intel$(echo .)com \
    --cc=ben.knoble@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=jacob.keller@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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