git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Thomas Gummerer <t.gummerer@gmail.com>,
	joostkremers@fastmail.fm
Subject: Re: [PATCH] stash: disable literal treatment when passing top pathspec
Date: Sat, 09 Apr 2022 00:10:32 -0400	[thread overview]
Message-ID: <877d7y3nif.fsf@kyleam.com> (raw)
In-Reply-To: <xmqqa6cvmmzn.fsf@gitster.g>

Junio C Hamano writes:

> Kyle Meyer <kyle@kyleam.com> writes:
[...]
>>  * the 'git clean' call, triggered by --include-untracked, does not
>>    remove untracked files from the working tree
>>
>>  * the 'git checkout' call, triggered by --keep-index, fails with a
>>    message about ":/" not matching any known files, and the main
>>    command exits with a non-zero status
>>
>> Fix both of these spots by passing --no-literal-pathspecs to the
>> subprocess commands.
>
> Yuck (to the original problem, not to the proposed solution).
>
> I wonder if stopping to use ":/" (or using "." instead, if we need
> to give _some_ pathspec) is a better approach.  Don't we move to the
> top of the working tree by the time cmd_stash() is called and whatever
> subprocess we spawn via run_command() interface will start at the
> top anyway, no?

For the --keep-index/checkout case, yes, it looks like the command
starts from the top-level.  Passing "." as the pathspec to checkout
works fine, as far as I can tell.

However, for --include-untracked/clean case, the subprocess directory is
set to startup_info->original_cwd since 0fce211ccc (stash: do not
attempt to remove startup_info->original_cwd, 2021-12-09).

  reply	other threads:[~2022-04-09  4:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08  3:12 [PATCH] stash: disable literal treatment when passing top pathspec Kyle Meyer
2022-04-08  6:33 ` Bagas Sanjaya
2022-04-08  8:46   ` Ævar Arnfjörð Bjarmason
2022-04-08 18:47     ` Junio C Hamano
2022-04-08 18:46 ` Junio C Hamano
2022-04-09  4:10   ` Kyle Meyer [this message]
2022-04-11 17:55     ` 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=877d7y3nif.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=joostkremers@fastmail.fm \
    --cc=t.gummerer@gmail.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.
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).