summaryrefslogtreecommitdiff
path: root/builtin-remote.c
Commit message (Collapse)AuthorAgeFilesLines
* Make "git-remote rm" delete refs acccording to fetch specsShawn O. Pearce2008-05-311-14/+54
| | | | | | | | | | | | | | | | | | | | | | A remote may be configured to fetch into tracking branches that don't match its name. A user may have created a remote by hand that will fetch to a different tracking branch namespace: [remote "alt"] url = git://repo.or.cz/alt-git.git fetch = refs/heads/*:refs/remotes/origin/* When deleting remote alt we should clean up the refs whose names start with "refs/remotes/origin/", even though the remote itself was named alt by the user. To avoid deleting refs used by another remote we only clear refs that are unique to this remote. This prevents `git prune rm alt` from removing the refs used by say origin if alt was just using a different URL for the same repository. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Make "git-remote prune" delete refs according to fetch specsShawn O. Pearce2008-05-311-19/+2
| | | | | | | | | | | | | | | | | | | | | | A remote may be configured to fetch into tracking branches that do not match the remote name. For example a user may have created extra remotes that will fetch to the same tracking branch namespace, but from different URLs: [remote "origin"] url = git://git.kernel.org/pub/scm/git/git.git fetch = refs/heads/*:refs/remotes/origin/* [remote "alt"] url = git://repo.or.cz/alt-git.git fetch = refs/heads/*:refs/remotes/origin/* When running `git remote prune alt` we expect stale branches to be removed from "refs/remotes/origin/*" and not from the unused namespace of "refs/remotes/alt/*". Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Remove unused remote_prefix member in builtin-remoteShawn O. Pearce2008-05-311-3/+0
| | | | | | | | Not sure when this became unused, but no code references it, other than to populate the strbuf with an initial value. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Provide git_config with a callback-data parameterJohannes Schindelin2008-05-141-4/+4
| | | | | | | | | | | | git_config() only had a function parameter, but no callback data parameter. This assumes that all callback functions only modify global variables. With this patch, every callback gets a void * parameter, and it is hoped that this will help the libification effort. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'pb/remote-mirror-config'Junio C Hamano2008-05-051-0/+7
|\ | | | | | | | | * pb/remote-mirror-config: Add a remote.*.mirror configuration option
| * Add a remote.*.mirror configuration optionPaolo Bonzini2008-04-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a remote.*.mirror configuration option that, when set, automatically puts git-push in --mirror mode for that remote. Furthermore, the option is set automatically by `git remote add --mirror'. The code in remote.c to parse remote.*.skipdefaultupdate had a subtle problem: a comment in the code indicated that special care was needed for boolean options, but this care was not used in parsing the option. Since I was touching related code, I did this fix too. [jc: and I further fixed up the "ignore boolean" code.] Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2008-04-241-0/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | * maint: remote: create fetch config lines with '+' push: allow unqualified dest refspecs to DWIM doc/git-gc: add a note about what is collected t5516: remove ambiguity test (1) Linked glossary from cvs-migration page write-tree: properly detect failure to write tree objects
| * remote: create fetch config lines with '+'Jeff King2008-04-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since git-remote always uses remote tracking branches, it should be safe to always force updates of those branches. I.e., we should generate fetch = +refs/heads/*:refs/remotes/$remote/* instead of fetch = refs/heads/*:refs/remotes/$remote/* This was the behavior of the perl version, which seems to have been lost in the C rewrite. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jk/remote-default-show'Junio C Hamano2008-04-191-1/+6
|\ \ | |/ |/| | | | | * jk/remote-default-show: git-remote: show all remotes with "git remote show"
| * git-remote: show all remotes with "git remote show"Jeff King2008-04-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many other commands use the "no arguments" form to show a list (e.g., git-branch, git-tag). While we did show all remotes for just "git remote", we displayed a usage error for "git remote show" with no arguments. This is counterintuitive, since by giving it _more_ information, we get _less_ result. The usage model can now be thought of as: - "git remote show <remote>": show a remote - "git remote show": show all remotes - "git remote": assume "show"; i.e., shorthand for "git remote show" Signed-off-by: Jeff King <peff@peff.net> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-remote: reject adding remotes with invalid namesJonas Fonseca2008-04-181-3/+7
|/ | | | | | | | | | | | | This can happen if the arguments to git-remote add is switched by the user, and git would only show an error if fetching was also requested. Fix it by using the refspec parsing engine to check if the requested name can be parsed as a remote before add it. Also cleanup so that the "remote.<name>.url" config name buffer is only initialized once. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-remote: Fix missing newline at end of listing of pushed branchesJohannes Sixt2008-03-231-0/+1
| | | | | | | | | | | | | | | | Without this the output of 'git remote show' does not end with a new-line: bash> git remote show repo * remote repo URL: repo.or.cz:/srv/git/kdbg.git Tracked remote branches maint master mob Local branch pushed with 'git push' +master:masterbash> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* remote show: do not show symbolic refsJohannes Schindelin2008-03-191-1/+4
| | | | | | | | | | | | For symbolic refs, a sane notion of being "stale" is that the ref they point to no longer exists. Since this is checked already, "remote show" does not need to show them at all. Incidentally, this fixes the issue that "HEAD" was shown as a stale ref by "remote show" in a freshly cloned repository. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* "remote update": print remote name being fetched fromSamuel Tardieu2008-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | When the other end has dangling symref, "git fetch" issues an error message but that is not grave enough to cause the fetch process to fail. As the result, the user will see something like this: $ git remote update error: refs/heads/2.0-uobjects points nowhere! "remote update" used to report which remote it is fetching from, like this: $ git remote update Updating core Updating matthieu error: refs/heads/2.0-uobjects points nowhere! Updating origin This reinstates the message "Updating <name>" in "git remote update". Signed-off-by: Samuel Tardieu <sam@rfc1149.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin remote rm: remove symbolic refs, tooJohannes Schindelin2008-03-081-0/+5
| | | | | | | | | | "git remote add" can add a symbolic ref "HEAD", and "rm" should delete it, too. Noticed by Teemu Likonen. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* remote: fix "update [group...]"Johannes Schindelin2008-03-051-9/+50
| | | | | | | | | | | | The rewrite in C inadvertently broke updating with remote groups: when you pass parameters to "git remote update", it used to look up "remotes.<group>" for every parameter, and interpret the value as a list of remotes to update. Also, no parameter, or a single parameter "default" should update all remotes that have not been marked with "skipDefaultUpdate". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* remote show: Clean up connection correctly if object fetch wasn't doneJohannes Schindelin2008-03-021-0/+1
| | | | | | | | Like in ls-remote, we have to disconnect the transport after getting the remote refs. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-remote: prune remotes correctly that were added with --mirrorJohannes Schindelin2008-03-011-3/+13
| | | | | | | This adds special handling for mirror remotes. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Make git-remote a builtinJohannes Schindelin2008-03-011-0/+547
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>