git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Denton Liu <liu.denton@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3 0/3] Teach submodule set-branch subcommand
Date: Thu, 07 Feb 2019 10:01:40 -0800	[thread overview]
Message-ID: <xmqqo97npjej.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <cover.1549534460.git.liu.denton@gmail.com> (Denton Liu's message of "Thu, 7 Feb 2019 02:18:52 -0800")

Denton Liu <liu.denton@gmail.com> writes:

> I rebased the changes onto the latest 'next' because if this branch gets
> merged into 'next', there'll be merge conflicts from
> 'dl/complete-submodule-absorbgitdirs'.

Please don't do that.

A topic that depends on everything in 'next' cannot graduate to
'master' until everything that is cooking in 'next' does.

When

 - the "conflict" that would arise is so trivial to resolve,

 - there is no semantic crashes between the new topic and existing
    ones, and

 - the topic is usable even before other topics graduate (or even
   when they get discarded)

please make it a habit to avoid making your topic (i.e. this one)
hostage to another topic (i.e. the absorbgitdirs one), and certainly
not hostage to the whole of 'next'.  A trivial conflict resolution
in this case, if you revert the rebasing and then attempt to merge
the result to 'next', would look like this.

diff --cc contrib/completion/git-completion.bash
index 8b3b5a9d34,de56879960..0000000000
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@@ -2573,7 -2573,7 +2573,7 @@@ _git_submodule (
  {
  	__git_has_doubledash && return
  
- 	local subcommands="add status init deinit update set-branch summary foreach sync"
 -	local subcommands="add status init deinit update summary foreach sync absorbgitdirs"
++	local subcommands="add status init deinit update set-branch summary foreach sync absorbgitdirs"
  	local subcommand="$(__git_find_on_cmdline "$subcommands")"
  	if [ -z "$subcommand" ]; then
  		case "$cur" in


By the way, if conflicts worry you so much, one thing you could do
is this.  Instead of maintaining the ever-growing list of
subcommands and having to worry about textual conflicts, the
completion script could use a clean-up to reduce the need of textual
conflict resolution, when it is quiescent, perhaps like this (I am
assuming that in some future, there is a quiescent period _after_
both of these two topics landed, and this illustration patch is to
be used in such a future).

Merging two topics, each of which adds a new element by inserting a
new line with the element (and the element alone) is on it, is
certainly a lot easier and simpler than having to see what word is
getting inserted by each topic on a single long string on a line.


 contrib/completion/git-completion.bash | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0fccadfc97..5d7d4ebacc 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2573,7 +2573,18 @@ _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
+		summary
+		foreach
+		sync
+		absorbgitdirs
+	"
 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
 	if [ -z "$subcommand" ]; then
 		case "$cur" in




  parent reply	other threads:[~2019-02-07 18:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 10:59 [PATCH 0/3] Teach submodule set-branch subcommand Denton Liu
2019-02-06 10:59 ` [PATCH 1/3] git-submodule.txt: document default behavior without --branch Denton Liu
2019-02-06 18:46   ` Junio C Hamano
2019-02-06 10:59 ` [PATCH 2/3] submodule--helper: teach config subcommand --unset Denton Liu
2019-02-06 19:07   ` Junio C Hamano
2019-02-06 10:59 ` [PATCH 3/3] submodule: teach set-branch subcommand Denton Liu
2019-02-07  6:32 ` [PATCH v2 0/3] Teach submodule " Denton Liu
2019-02-07  6:32   ` [PATCH v2 1/3] git-submodule.txt: document default behavior without --branch Denton Liu
2019-02-07  6:32   ` [PATCH v2 2/3] submodule--helper: teach config subcommand --unset Denton Liu
2019-02-07  6:33   ` [PATCH v2 3/3] submodule: teach set-branch subcommand Denton Liu
2019-02-07 10:18   ` [PATCH v3 0/3] Teach submodule " Denton Liu
2019-02-07 10:18     ` [PATCH v3 1/3] git-submodule.txt: "--branch <branch>" option defaults to 'master' Denton Liu
2019-02-07 10:18     ` [PATCH v3 2/3] submodule--helper: teach config subcommand --unset Denton Liu
2019-02-07 20:05       ` Junio C Hamano
2019-02-07 22:29       ` Junio C Hamano
2019-02-07 10:19     ` [PATCH v3 3/3] submodule: teach set-branch subcommand Denton Liu
2019-02-07 22:26       ` Junio C Hamano
2019-02-07 18:01     ` Junio C Hamano [this message]
2019-02-08  5:31       ` [PATCH v3 0/3] Teach submodule " Denton Liu
2019-02-08 18:43         ` Junio C Hamano
2019-02-08 11:21     ` [PATCH v4 " Denton Liu
2019-02-08 11:21       ` [PATCH v4 1/3] git-submodule.txt: "--branch <branch>" option defaults to 'master' Denton Liu
2019-02-08 11:21       ` [PATCH v4 2/3] submodule--helper: teach config subcommand --unset Denton Liu
2019-02-08 11:21       ` [PATCH v4 3/3] submodule: teach set-branch subcommand Denton Liu
2019-02-08 23:51         ` Denton Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqo97npjej.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).