All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [RFH] "git -C there add foo" completes, s/add/diff/ does not
Date: Wed, 07 Feb 2024 10:34:56 -0800	[thread overview]
Message-ID: <xmqqcyt89l7z.fsf@gitster.g> (raw)

As some of you may already know, I keep an untracked directory
called "Meta" at the top-level of the working tree of the Git
source tree.  This "Meta" directory is actually a single-branch
clone of the git.kernel.org/pub/scm/git/git.git that checks out
its "todo" branch, where files like whats-cooking.txt lives.

So, what I often would do is

    $ git -C Meta add whats-cooking.txt

after updating the draft of the next issue of the "What's cooking"
report.  The command line completion support for "git add" knows how
to complete this when I stopped typing the above after whats-" and
hit <TAB>.  It seems that __git_find_repo_path helper function that
notices "-C there" and discovers the $GIT_DIR, and _git_add helper
uses __git_complete_index_file that honors the discovered $GIT_DIR
to find paths in the correct index, which is wonderful.

But the same does not work for the step before I can decide to
actually "add" the contents, which is to "diff", i.e.

    $ git -C Meta diff whats-<TAB>

does not complete.

Anybody wants to take a crack at it?

Thanks.


             reply	other threads:[~2024-02-07 18:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-07 18:34 Junio C Hamano [this message]
2024-02-08  2:50 ` [RFH] "git -C there add foo" completes, s/add/diff/ does not Kyle Lippincott
2024-02-08  6:04   ` 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=xmqqcyt89l7z.fsf@gitster.g \
    --to=gitster@pobox.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.