From: Junio C Hamano <gitster@pobox.com>
To: "Britton Leo Kerin" <britton.kerin@gmail.com>
Cc: <git@vger.kernel.org>
Subject: Re: [PATCH 1/1] completion: dir-type optargs for am, format-patch
Date: Mon, 08 Jan 2024 10:37:55 -0800 [thread overview]
Message-ID: <xmqqttnnk6ws.fsf@gitster.g> (raw)
In-Reply-To: <8a8dfcfc-3369-42b8-8387-f1af33202b16@smtp-relay.sendinblue.com> (Britton Leo Kerin's message of "Sun, 7 Jan 2024 12:42:00 -0900")
"Britton Leo Kerin" <britton.kerin@gmail.com> writes:
> + local context_dir=$(__git rev-parse --show-toplevel --show-prefix 2>/dev/null | paste -s -d '/' 2>/dev/null)
Is there a practical difference with the above with
context_dir=$(pwd)
other than that it will give an empty string outside a git working tree?
If not, I suspect
local inside
inside=$(__git rev-parse --is-inside-work-tree) &&
test "$inside" = true || return
local context_dir=$(pwd)
might be clearer on the intent.
> + [ -d "$context_dir" ] || return
> +
> + COMPREPLY=$(cd $context_dir 2>/dev/null && compgen -d -- "$cur_")
Can $context_dir contain $IFS whitespaces here?
> +}
prev parent reply other threads:[~2024-01-08 18:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240107214200.29684-1-britton.kerin@gmail.com>
2024-01-07 21:42 ` [PATCH 1/1] completion: dir-type optargs for am, format-patch Britton Leo Kerin
2024-01-08 18:37 ` Junio C Hamano [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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqttnnk6ws.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=britton.kerin@gmail.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.