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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: git-owner@xxxxxxxxxxxxxxx [mailto:git-owner@xxxxxxxxxxxxxxx] 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@xxxxxxxxx>
> ---
>  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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]