From 26b061007c1259ed4692554994961dd26874e63e Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Tue, 29 Oct 2019 10:01:52 -0700 Subject: submodule: teach set-url subcommand Currently, in the event that a submodule's upstream URL changes, users have to manually alter the URL in the .gitmodules file then run `git submodule sync`. Let's make that process easier. Teach submodule the set-url subcommand which will automatically change the `submodule.$name.url` property in the .gitmodules file and then run `git submodule sync` to complete the process. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/completion') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 00fbe6c03d..88c7446414 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2779,7 +2779,7 @@ _git_submodule () { __git_has_doubledash && return - local subcommands="add status init deinit update set-branch summary foreach sync absorbgitdirs" + local subcommands="add status init deinit update set-branch set-url summary foreach sync absorbgitdirs" local subcommand="$(__git_find_on_cmdline "$subcommands")" if [ -z "$subcommand" ]; then case "$cur" in -- cgit v1.2.3 From 15beaaa3d1f6b555900446deb5e376b4f806d734 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Tue, 5 Nov 2019 17:07:23 +0000 Subject: Fix spelling errors in code comments Reported-by: Jens Schleusener Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/completion') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 00fbe6c03d..47c551091f 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -550,7 +550,7 @@ __git_index_files () esc_idx, 1) } else if (esc == "n") { # Uh-oh, a newline character. - # We cant reliably put a pathname + # We cannot reliably put a pathname # containing a newline into COMPREPLY, # and the newline would create a mess. # Skip this path. @@ -565,7 +565,7 @@ __git_index_files () } } # Drop closing double quote, if there is one. - # (There isnt any if this is a directory, as it was + # (There is not any if this is a directory, as it was # already stripped with the trailing path components.) if (substr(p, length(p), 1) == "\"") out = out substr(p, 1, length(p) - 1) -- cgit v1.2.3 From c1ce9c06d0a0e8ad473bdbe800e8e089b8314e24 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Mon, 11 Nov 2019 13:25:20 -0800 Subject: completion: learn to complete `git rebase --onto=` In 2b9bd488ae ("completion: teach rebase to use __gitcomp_builtin", 2019-09-12), the completion script learned to complete rebase using __gitcomp_builtin(). However, this resulted in `--onto=` being suggested instead of `--onto `. Before, when there was a space, we'd start a new word and, as a result, fallback to __git_complete_refs() and `--onto` would be completed this way. However, now we match the `--*` case which does not know how to offer completions for refs. Teach _git_rebase() to complete refs in the `--onto=` case so that we fix this regression. Reported-by: Paul Jolly Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'contrib/completion') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 7b1ab46f0b..2b644056af 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2021,6 +2021,10 @@ _git_rebase () __gitcomp "$__git_whitespacelist" "" "${cur##--whitespace=}" return ;; + --onto=*) + __git_complete_refs --cur="${cur##--onto=}" + return + ;; --*) __gitcomp_builtin rebase "" \ "$__git_rebase_interactive_inprogress_options" -- cgit v1.2.3 From 1f9247a3bd809b770bf9acfa0877467621a76d69 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Wed, 13 Nov 2019 00:47:52 +0000 Subject: completion: tab-complete "git svn --recursive" Signed-off-by: James Shubin Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 1 + 1 file changed, 1 insertion(+) (limited to 'contrib/completion') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index e087c4bf00..51ca63673d 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2730,6 +2730,7 @@ _git_svn () --log-window-size= --no-checkout --quiet --repack-flags --use-log-author --localtime --add-author-from + --recursive --ignore-paths= --include-paths= $remote_opts " local init_opts=" -- cgit v1.2.3 From f0f9de2bd71b41afeb2a2a77a681a15a83246a62 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Tue, 19 Nov 2019 16:51:11 -0800 Subject: completion: complete `tformat:` pretty format Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/completion') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index e087c4bf00..6bf91ab154 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1737,7 +1737,7 @@ __git_log_shortlog_options=" --all-match --invert-grep " -__git_log_pretty_formats="oneline short medium full fuller email raw format: mboxrd" +__git_log_pretty_formats="oneline short medium full fuller email raw format: tformat: mboxrd" __git_log_date_formats="relative iso8601 iso8601-strict rfc2822 short local default raw unix format:" _git_log () -- cgit v1.2.3 From 1f0fc1db8599f87520494ca4f0e3c1b6fabdf997 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Tue, 19 Nov 2019 16:51:25 -0800 Subject: pretty: implement 'reference' format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The standard format for referencing other commits within some projects (such as git.git) is the reference format. This is described in Documentation/SubmittingPatches as If you want to reference a previous commit in the history of a stable branch, use the format "abbreviated hash (subject, date)", like this: .... Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30) noticed that ... .... Since this format is so commonly used, standardize it as a pretty format. The tests that are implemented essentially show that the format-string does not change in response to various log options. This is useful because, for future developers, it shows that we've considered the limitations of the "canned format-string" approach and we are fine with them. Based-on-a-patch-by: SZEDER Gábor Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/completion') diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 6bf91ab154..889e707a05 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1737,7 +1737,7 @@ __git_log_shortlog_options=" --all-match --invert-grep " -__git_log_pretty_formats="oneline short medium full fuller email raw format: tformat: mboxrd" +__git_log_pretty_formats="oneline short medium full fuller reference email raw format: tformat: mboxrd" __git_log_date_formats="relative iso8601 iso8601-strict rfc2822 short local default raw unix format:" _git_log () -- cgit v1.2.3