git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Andreas G. Schacker" <andreas.schacker@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] doc/read-tree: remove obsolete remark
Date: Thu, 11 Jan 2018 19:35:04 -0500	[thread overview]
Message-ID: <20180112003503.GA14128@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqd12gxa2o.fsf@gitster.mtv.corp.google.com>

On Thu, Jan 11, 2018 at 03:14:07PM -0800, Junio C Hamano wrote:

> >> Doesn't "git read-tree --prefix=previous HEAD^" add paths like
> >> "previous/Documentation/Makefile" to the index, i.e. instead of
> >> forcing you to have the required slash at the end, we give one for
> >> free when it is missing?
> >
> > Yes, I think it does what you'd want with that path. But it would not do
> > what you want by adding "previous-file". Which seems like a gotcha that
> > should be mentioned.
> 
> I am a bit puzzled.  
> 
> Do you mean a user who types "git read-tree --prefix=v1- HEAD^" may
> be expecting to see that the blob object "HEAD^:Makefile" added at
> path "v1-Makefile" etc?

Sorry, I was somewhat turned around in my example, thinking that we were
matching existing entries by prefix here and not putting entries into a
new prefix[1].

But yes, your example hits the point that I think is left unsaid: does
"--prefix=sub" mean the same thing as "--prefix=sub/", or is it a true
string prefix? Reading more carefully, though, we say "under the
directory at <prefix>" in the earlier part, which is probably
sufficient.

Note that this _is_ different than "git checkout-index --prefix", which
is a strict string prefix (i.e., you can checkout "--prefix=v1-" and get
"v1-Makefile").

-Peff

[1] I was trying to figure out which feature of Git I was confusing it
    with, but couldn't find one. I think I may have just been thinking
    of checkout-index (which is not about matching existing paths, but
    does have the different behavior). Normally matching of existing
    paths is done with pathspecs, which I think should all use directory
    boundaries for prefix-matching.

      reply	other threads:[~2018-01-12  0:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 15:30 [PATCH] doc/read-tree: remove obsolete remark Andreas G. Schacker
2018-01-09 19:36 ` Junio C Hamano
2018-01-11 10:49 ` Jeff King
2018-01-11 19:02   ` Junio C Hamano
2018-01-11 22:21     ` Jeff King
2018-01-11 23:14       ` Junio C Hamano
2018-01-12  0:35         ` Jeff King [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180112003503.GA14128@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=andreas.schacker@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).