git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bogdan Butnaru <bbutnaru@qotilabs.com>
To: git@vger.kernel.org
Subject: Fwd: Path instead of pathspec for “git checkout <tree-ish> [--] <pathspec>”
Date: Wed, 11 Sep 2019 10:11:03 +0200	[thread overview]
Message-ID: <CA+oNJzKoQ-PmwY=p2W5HhCk1qn-BCwAKMZzZUn_7p2GVi-r9=w@mail.gmail.com> (raw)
In-Reply-To: <CA+oNJz+N_b6Gq-gVu0ZnGbL_ppdu0LDSfqPJjsV8QAghrS1Rkg@mail.gmail.com>

Hello!

Not sure if I’m doing something wrong here, but it seems that when
calling “git checkout <tree-ish> [--] <pathspec>”, the last argument
is not interpreted correctly.

I have a repository that contains a multi-module Maven project, and as
such it contains several “pom.xml” files, one in the root directory
and a few others in sub-directories. If I understand correctly the
documentation, calling “git checkout 0123abcdef -- :/**pom.xml” should
checkout (to the working tree and the index) all files named “pom.xml”
from revision 0123abcdef. As of version 2.23.0.windows.1 it only
checks out the “pom.xml” file from the root of the repository.

However, if I run “git checkout --patch 0123abcdef -- :/**pom.xml”,
then during the interactive process I am asked about changes from all
“pom.xml” files, everywhere in the directory hierarchy. (The short
form “-p” also works.) If I just type “a” at every prompt, I get what
I expected from the first command, i.e. all matching files in the
given revision.

(I just tested that version now because it’s the newest I can find.
But the issue happens since at least 2.20, probably earlier.)

Cheers,
—Bogdan Butnaru

           reply	other threads:[~2019-09-11  8:11 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CA+oNJz+N_b6Gq-gVu0ZnGbL_ppdu0LDSfqPJjsV8QAghrS1Rkg@mail.gmail.com>]

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='CA+oNJzKoQ-PmwY=p2W5HhCk1qn-BCwAKMZzZUn_7p2GVi-r9=w@mail.gmail.com' \
    --to=bbutnaru@qotilabs.com \
    --cc=git@vger.kernel.org \
    /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).