{"thread":{"id":"28491","subject":"[PATCH] git-completion: offer remotes for 'git remote update'","startedAt":"2011-09-25T12:06:50Z","lastAt":"2011-09-28T08:54:28Z","messageCount":4,"participants":["Auke Schrijnen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"176163","messageId":"347b845858abcc62551d83df324e5c10@schrijnen.nl","threadId":"28491","inReplyTo":null,"subject":"[PATCH] git-completion: offer remotes for 'git remote update'","fromName":"Auke Schrijnen","fromEmail":"auke@schrijnen.nl","sentAt":"2011-09-25T12:06:50Z","receivedAt":"2011-09-25T12:06:50Z","isPatch":true,"sender":{"key":"auke@schrijnen.nl","avatar":"https://gravatar.com/avatar/6464be41c7db9ed921ded6170b2cf512473dcf66c9b5c0595daabe2a888c8b79?d=mp&s=160"},"body":"Completion for 'git remote update' only offers configured remote\ngroups.\n\nAdd all remotes to the completion.\n\nSigned-off-by: Auke Schrijnen <auke@schrijnen.nl>\n---\n  contrib/completion/git-completion.bash |    2 +-\n  1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash \nb/contrib/completion/git-completion.bash\nindex 8648a36..ad2175c 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2293,7 +2293,7 @@ _git_remote ()\n  \t\t__gitcomp \"$(__git_remotes)\"\n  \t\t;;\n  \tupdate)\n-\t\tlocal i c='' IFS=$'\\n'\n+\t\tlocal i c=\"$(__git_remotes)\" IFS=$'\\n'\n  \t\tfor i in $(git --git-dir=\"$(__gitdir)\" config --get-regexp \n\"remotes\\..*\" 2>/dev/null); do\n  \t\t\ti=\"${i#remotes.}\"\n  \t\t\tc=\"$c ${i/ */}\"\n-- \n1.7.6.1\n"},{"id":"176375","messageId":"7v8vp9trvu.fsf@alter.siamese.dyndns.org","threadId":"28491","inReplyTo":"347b845858abcc62551d83df324e5c10@schrijnen.nl","subject":"Re: [PATCH] git-completion: offer remotes for 'git remote update'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-09-28T00:47:17Z","receivedAt":"2011-09-28T00:47:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Auke Schrijnen <auke@schrijnen.nl> writes:\n\n> Completion for 'git remote update' only offers configured remote\n> groups.\n\nI have this suspicion that it might even be a feature. I am a bad person\nto make the judgement, as I do not use the \"grouping\" feature at all.\n\nIf you throw in individual remotes that are not grouped in the mix, the\nusers of \"git remote update\" auto-completion, who have been happily\nrelying on seeing only the configured groups, suddenly will start seeing\nmany individual repositories offered, cluttering the available choices.\nBesides, if you want to fetch from a single source, why not use \"git\nfetch\" directly?\n\nBack when \"git fetch\" didn't allow fetching from multiple repositories in\none go, \"remote update\" was written as a wrapper for the explicit purpose\nof fetching from more than one remote by defining remote groups. Since\nlate 2009, \"git fetch\" can update from multiple remotes itself, and I\nsuspect \"git remote update\" outlived its usefulness in some sense, but\nthat is a tangent.\n"},{"id":"176392","messageId":"8afccd5cb106493a55415bec66328063@schrijnen.nl","threadId":"28491","inReplyTo":"7v8vp9trvu.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-completion: offer remotes for 'git remote update'","fromName":"Auke Schrijnen","fromEmail":"auke@schrijnen.nl","sentAt":"2011-09-28T08:52:29Z","receivedAt":"2011-09-28T08:52:29Z","isPatch":true,"sender":{"key":"auke@schrijnen.nl","avatar":"https://gravatar.com/avatar/6464be41c7db9ed921ded6170b2cf512473dcf66c9b5c0595daabe2a888c8b79?d=mp&s=160"},"body":"On Tue, 27 Sep 2011 17:47:17 -0700, Junio C Hamano wrote:\n> Auke Schrijnen <auke@schrijnen.nl> writes:\n>\n>> Completion for 'git remote update' only offers configured remote\n>> groups.\n>\n> I have this suspicion that it might even be a feature. I am a bad \n> person\n> to make the judgement, as I do not use the \"grouping\" feature at all.\n>\n> If you throw in individual remotes that are not grouped in the mix, \n> the\n> users of \"git remote update\" auto-completion, who have been happily\n> relying on seeing only the configured groups, suddenly will start \n> seeing\n> many individual repositories offered, cluttering the available \n> choices.\n> Besides, if you want to fetch from a single source, why not use \"git\n> fetch\" directly?\n>\n> Back when \"git fetch\" didn't allow fetching from multiple \n> repositories in\n> one go, \"remote update\" was written as a wrapper for the explicit \n> purpose\n> of fetching from more than one remote by defining remote groups. \n> Since\n> late 2009, \"git fetch\" can update from multiple remotes itself, and I\n> suspect \"git remote update\" outlived its usefulness in some sense, \n> but\n> that is a tangent.\n\nI see your point and obviously i'm also not using the grouping feature. \nI could just use git fetch but i'm so used to type 'git remote \nupdate'... So i'll cook another patch.\n\nAuke\n"},{"id":"176393","messageId":"1fe2227149aa8b1024dd0f220e32af20@schrijnen.nl","threadId":"28491","inReplyTo":"7v8vp9trvu.fsf@alter.siamese.dyndns.org","subject":"[PATCH] git-completion: offer remotes for 'git remote update'","fromName":"Auke Schrijnen","fromEmail":"auke@schrijnen.nl","sentAt":"2011-09-28T08:54:28Z","receivedAt":"2011-09-28T08:54:28Z","isPatch":true,"sender":{"key":"auke@schrijnen.nl","avatar":"https://gravatar.com/avatar/6464be41c7db9ed921ded6170b2cf512473dcf66c9b5c0595daabe2a888c8b79?d=mp&s=160"},"body":"Completion for 'git remote update' only offers configured remote\ngroups. This is fine if one uses remote groups but there is no\ncompletion without those groups.\n\nAdd all remotes to the completion when no configured groups are found.\n\nSigned-off-by: Auke Schrijnen <auke@schrijnen.nl>\n---\n  contrib/completion/git-completion.bash |    6 +++++-\n  1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash \nb/contrib/completion/git-completion.bash\nindex 8648a36..12058bf 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2298,7 +2298,11 @@ _git_remote ()\n  \t\t\ti=\"${i#remotes.}\"\n  \t\t\tc=\"$c ${i/ */}\"\n  \t\tdone\n-\t\t__gitcomp \"$c\"\n+\t\tif [ -z \"$c\" ]; then\n+\t\t\t__gitcomp \"$(__git_remotes)\"\n+\t\telse\n+\t\t\t__gitcomp \"$c\"\n+\t\tfi\n  \t\t;;\n  \t*)\n  \t\tCOMPREPLY=()\n-- \n1.7.6.1\n"}]}