summaryrefslogtreecommitdiff
path: root/builtin-ls-remote.c
AgeCommit message (Collapse)Author
2009-11-04Require a struct remote in transport_get()Daniel Barkalow
cmd_ls_remote() was calling transport_get() with a NULL remote and a non-NULL url in the case where it was run outside a git repository. This involved a bunch of ill-tested special cases. Instead, simply get the struct remote for the URL with remote_get(), which works fine outside a git repository, and can also take global options into account. This fixes a tiny and obscure bug where "git ls-remote" without a repo didn't support global url.*.insteadOf, even though "git clone" and "git ls-remote" in any repo did. Also, enforce that all callers provide a struct remote to transport_get(). Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-11git ls-remote: make usage string match manpageStefan Naewe
The usage string of 'git ls-remote' is pretty terse. The manpage however gives the correct 'synopsis'. Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-13Make usage strings dash-lessStephan Beyer
When you misuse a git command, you are shown the usage string. But this is currently shown in the dashed form. So if you just copy what you see, it will not work, when the dashed form is no longer supported. This patch makes git commands show the dash-less version. For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh generates a dash-less usage string now. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26Always set *nongit_ok in setup_git_directory_gently()SZEDER Gábor
setup_git_directory_gently() only modified the value of its *nongit_ok argument if we were not in a git repository. Now it will always set it to 0 when we are inside a repository. Also remove now unnecessary initializations in the callers of this function. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-04Merge branch 'maint'Junio C Hamano
* maint: Fix 'git remote show' regression on empty repository in 1.5.4 Fix incorrect wording in git-merge.txt. git-merge.sh: better handling of combined --squash,--no-ff,--no-commit options Fix random crashes in http_cleanup()
2008-03-04Fix 'git remote show' regression on empty repository in 1.5.4Shawn O. Pearce
Back in 18f7c51c we switched git-ls-remote/git-peek-remote to use the transport backend, rather than do everything itself. As part of that switch we started to produce a non-zero exit status if no refs were received from the remote peer, which happens when the remote peer has no commits pushed to it yet. (E.g. "git --git-dir=foo.git init; git ls-remote foo.git") Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-05Reduce the number of connects when fetchingDaniel Barkalow
This shares the connection between getting the remote ref list and getting objects in the first batch. (A second connection is still used to follow tags). When we do not fetch objects (i.e. either ls-remote disconnects after getting list of refs, or we decide we are already up-to-date), we clean up the connection properly; otherwise the connection is left open in need of cleaning up to avoid getting an error message from the remote end when ssh is used. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-16ls-remote: add -t and -h options.Miklos Vajna
These options are listed in the manpage (aliases for --tags/--heads) but they were not handled. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-09Re-fix ls-remoteJunio C Hamano
An earlier attempt in 2ea7fe0 (ls-remote: resurrect pattern limit support) forgot that the user string can also be a glob. This should finally fix it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-09ls-remote: resurrect pattern limit supportJunio C Hamano
"git ls-remote $remote $name1 $name2..." used to limit the output to refs that end with one of the $name given from the command line, but recent rewrite to C forgot to implement that support. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-07Reteach builtin-ls-remote to understand remotesShawn O. Pearce
Prior to being made a builtin git-ls-remote understood that when it was given a remote name we wanted it to resolve that to the pre-configured URL and connect to that location. That changed when it was converted to a builtin and many of my automation tools broke. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-05Build in ls-remoteDaniel Barkalow
This actually replaces peek-remote with ls-remote, since peek-remote now handles everything. peek-remote remains an a second name for ls-remote, although its help message now gives the "ls-remote" name. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>