git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [PATCH v3] ls-remote: fall-back to default remotes when no remote specified

From
Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Date
Apr 9, 2010, 08:49 UTC
Message-ID
<A612847CFE53224C91B23E3A5B48BAC7448206860D@xmail3.se.axis.com>
In-Reply-To
<1270747273-1504-1-git-send-email-rctay89@gmail.com>
Show 50 quoted lines
> -----Original Message-----
> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
> Behalf Of Tay Ray Chuan
> Sent: den 8 april 2010 19:21
> To: Git Mailing List
> Cc: Junio C Hamano; Jeff King
> Subject: [PATCH v3] ls-remote: fall-back to default remotes when no
> remote specified
> 
> Instead of breaking execution when no remote (as specified in the
> variable dest) is specified when git-ls-remote is invoked, continue on
> and let remote_get() handle it.
> 
> This way, we are able to use the default remotes (eg. "origin",
> branch.<name>.remote), as git-fetch, git-push, and other users of
> remote_get(), do.
> 
> If no suitable remote is found, exit with a message describing the
> issue, instead of just the usage text, as we do previously.
> 
> Add several tests to check that git-ls-remote handles the
> no-remote-specified situation.
> 
> Also add a test that "git ls-remote <pattern>" does not work; we are
> unable to guess the remote in that situation, as are git-fetch and
> git-push.
> 
> In that test, we are testing for messages coming from two separate
> processes, but we should be OK, because the second message is triggered
> by closing the fd which must happen after the first message is printed.
> (analysis by Jeff King.)
> 
> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
> ---
>  builtin/ls-remote.c  |   11 ++++++---
>  t/t5512-ls-remote.sh |   58
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 65 insertions(+), 4 deletions(-)
> 
> diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
> index 70f5622..6c738c9 100644
> --- a/builtin/ls-remote.c
> +++ b/builtin/ls-remote.c
> @@ -4,7 +4,8 @@
>  #include "remote.h"
> 
>  static const char ls_remote_usage[] =
> -"git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>] <repository> <refs>...";
> +       "git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>]\n"
> +"                     [<repository> [<refs>...]]";
That should be:
static const char ls_remote_usage[] =
	"git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>]\n"
	"              [<repository> [<refs>...]]";
or the second line of the usage will not be indented as intended.
//Peter
Previous: Jeff KingNext: Tay Ray Chuan
Message 17 of 18 in “ls-remote: default to 'origin' when no remote specified”
  1. ls-remote: default to 'origin' when no remote specifiedTay Ray Chuan, Apr 8, 2010
  2. Jeff KingApr 8, 2010
  3. Junio C HamanoApr 8, 2010
  4. Jeff KingApr 8, 2010
  5. Tay Ray ChuanApr 8, 2010
  6. Jeff KingApr 8, 2010
  7. Junio C HamanoApr 8, 2010
  8. Jeff KingApr 8, 2010
  9. Junio C HamanoApr 8, 2010
  10. Tay Ray ChuanApr 8, 2010
  11. ls-remote: fall-back to default remotes when no remote specifiedTay Ray Chuan, Apr 8, 2010
  12. ls-remote: fall-back to default remotes when no remote specifiedTay Ray Chuan, Apr 8, 2010
  13. Jeff KingApr 8, 2010
  14. Tay Ray ChuanApr 8, 2010
  15. ls-remote: fall-back to default remotes when no remote specifiedTay Ray Chuan, Apr 8, 2010
  16. Jeff KingApr 8, 2010
  17. Peter KjellerstedtApr 9, 2010
  18. Tay Ray ChuanApr 9, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.