git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Rohit Sarkar <rohitsarkar5398@gmail.com>
To: git@vger.kernel.org
Cc: rohitsarkar5398@gmail.com
Subject: git checkout with an ambiguous rev
Date: Wed, 2 Oct 2019 17:32:13 +0530	[thread overview]
Message-ID: <20191002120213.GB5812@SARKAR> (raw)

Hi,
I was looking into writing a patch for the issue [1] where if an user has
multiple remotes each with a remote tracking branch of the same name say
xyz, 'git checkout xyz' fails with "error: pathspec 'xyz' did not match any
file(s) known to git."

This can sort of be handled by setting checkout.defaultRemote so that
the ambiguity is removed. Although when checkout.defaultRemote is not
set or there are more than 2 remotes I think it would be helpful if git
gives a message listing out the possible revs instead of the pathspec
error. What do you guys think?

[1] : https://public-inbox.org/git/CACcTrKdzVCKUR8EfwhqBQR7vWzRqTLcwRJ_r-hx3VztD=xvNuQ@mail.gmail.com/

             reply	other threads:[~2019-10-02 12:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 12:02 Rohit Sarkar [this message]
2019-10-02 13:28 ` git checkout with an ambiguous rev Rohit Sarkar

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=20191002120213.GB5812@SARKAR \
    --to=rohitsarkar5398@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.
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).