git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Heiko Voigt <hvoigt@hvoigt.net>, Junio C Hamano <gitster@pobox.com>
Cc: "W. Trevor King" <wking@tremily.us>,
	Johan Herland <johan@herland.net>,
	Git mailing list <git@vger.kernel.org>
Subject: Re: Possible regression in master? (submodules without a "master" branch)
Date: Fri, 28 Mar 2014 00:06:02 +0100	[thread overview]
Message-ID: <5334AEDA.70002@web.de> (raw)
In-Reply-To: <20140327202702.GA3984@sandbox-ub>

Am 27.03.2014 21:27, schrieb Heiko Voigt:
> On Thu, Mar 27, 2014 at 12:39:03PM -0700, Junio C Hamano wrote:
>> "W. Trevor King" <wking@tremily.us> writes:
>>
>>> On Thu, Mar 27, 2014 at 06:31:27PM +0100, Jens Lehmann wrote:
>>>> Am 27.03.2014 18:16, schrieb Junio C Hamano:
>>>>> Johan Herland <johan@herland.net> writes:
>>>>>
>>>>>> I just found a failure to checkout a project with submodules where
>>>>>> there is no explicit submodule branch configuration, and the
>>>>>> submodules happen to not have a "master" branch:
>>>>>>
>>>>>>   git clone git://gitorious.org/qt/qt5.git qt5
>>>>>>   cd qt5
>>>>>>   git submodule init qtbase
>>>>>>   git submodule update
>>>>>>
>>>>>> In current master, the last command fails with the following output:
>>>>>
>>>>> ... and with a bug-free system, what does it do instead?  Just clone
>>>>> 'qtbase' and make a detached-head checkout at the commit recorded in
>>>>> the superproject's tree, or something else?
>>>>
>>>> After reverting 23d25e48f5ead73 on current master it clones 'qtbase'
>>>> nicely with a detached HEAD.
>>>
>>> Fixing this for initial update clone is pretty easy, we just need to
>>> unset start_point before calling module_clone if
>>> submodule.<name>.branch is not set. 
>>
>> There is this bit for "update" in git-submodule.txt:
>>
>>   For updates that clone missing submodules, checkout-mode updates
>>   will create submodules with detached HEADs; all other modes will
>>   create submodules with a local branch named after
>>   submodule.<path>.branch.
>>
>>   [side note] Isn't that a typo of submodule.<name>.branch?
> 
> Yep, thats is a typo. Trevor will you fix that as well? Or how should be
> do that? Since its just such a small change.
> 
>> So the proposed change is to make the part before semicolon true?

Definitely. But not only for the initial clone, that should hold
true for all subsequent updates too.

>> If we are not newly cloning (because we already have it), if the
>> submodule.<name>.branch is not set *OR* refers to a branch that does
>> not even exist, shouldn't we either (1) abort as an error, or (2) do
>> the same and detach?
> 
> I would expect "(1) abort as an error" since the user is not getting what
> he would expect.

I believe that depends on the 'update' setting. If it is either not
set or set to 'checkout', it should simply detach when 'branch' is
not set. So it is "(2) do the same and detach" in that case. Otherwise
I agree with Heiko.

>>> However, that's just going to
>>> push remote branch ambiguity problems back to the --remote update
>>> functionality.  What should happen when submodule.<name>.branch is not
>>> set and you run a --remote update, which has used:
>>>
>>>     git rev-parse "${remote_name}/${branch}"
>>>
>>> since the submodule.<name>.branch setting was introduced in 06b1abb
>>> (submodule update: add --remote for submodule's upstream changes,
>>> 2012-12-19)?
>>
>> Isn't --remote about following one specific branch the user who
>> issues that command has in mind?  If you as the end user did not
>> give any indication which branch you meant, e.g. by leaving the
>> submodule.<name>.branch empty, shouldn't that be diagnosed as an
>> error?
> 
> Well to simplify things there was this fallback to origin/master
> (similar to the master branch we create on init) since that is a branch
> which many projects have. E.g. for the users that share one central
> server and just directly commit, push and pull to/from master. They
> would have an easy way to start working in a submodule, by simply saying
> --remote and then committing to master. At least that is what I
> imagine.

I'd really like to see more feedback on this from people who actually
use the 'merge' and 'rebase' update modes with or without 'branch' set.

>>> gitmodules(5) is pretty clear that 'submodule.<name>.branch' defaults
>>> to master (and not upstream's HEAD), do we want to adjust this at the
>>> same time?
>>
>> That may be likely.  If the value set to a configuration variable
>> causes an established behaviour of a program change a lot, silently
>> defaulting that variable to something many people are expected to
>> have (e.g. 'master') would likely to cause a usability regression.
> 
> IMO this branch configuration should completely ignored in the default,
> non --remote, usage. Since we simply checkout a specific SHA1 in this
> case, that should be possible.

Yes.

  reply	other threads:[~2014-03-27 23:06 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 14:21 Possible regression in master? (submodules without a "master" branch) Johan Herland
2014-03-27 15:52 ` W. Trevor King
2014-03-27 15:57   ` W. Trevor King
2014-03-27 17:23   ` Jens Lehmann
2014-03-27 18:30     ` Junio C Hamano
2014-03-27 22:55       ` Jens Lehmann
2014-03-27 23:27         ` Johan Herland
2014-03-28  2:33         ` W. Trevor King
2014-03-27 17:16 ` Junio C Hamano
2014-03-27 17:31   ` Jens Lehmann
2014-03-27 18:54     ` W. Trevor King
2014-03-27 19:39       ` Junio C Hamano
2014-03-27 20:27         ` Heiko Voigt
2014-03-27 23:06           ` Jens Lehmann [this message]
2014-03-27 23:21           ` Johan Herland
2014-03-28  3:05             ` W. Trevor King
2014-03-28  3:36               ` [RFC] submodule: change submodule.<name>.branch default from master to HEAD W. Trevor King
2014-03-28  3:43                 ` Eric Sunshine
2014-03-28  3:52                   ` W. Trevor King
2014-03-28  3:58                     ` W. Trevor King
2014-03-28 16:57                       ` Jens Lehmann
2014-03-28 17:10                         ` W. Trevor King
2014-03-31 19:31                           ` Jens Lehmann
2014-03-28 17:28                         ` Junio C Hamano
2014-03-31 19:35                 ` Jens Lehmann
2014-03-31 20:38                   ` W. Trevor King
2014-03-31 20:45                   ` Junio C Hamano
2014-03-27 21:01         ` submodule.<path>.branch vs. submodule.<name>.branch (was: Possible regression in master? (submodules without a "master" branch) W. Trevor King
2014-03-27 21:37           ` submodule.<path>.branch vs. submodule.<name>.branch Junio C Hamano

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

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

  git send-email \
    --in-reply-to=5334AEDA.70002@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=johan@herland.net \
    --cc=wking@tremily.us \
    /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.
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 NNTP newsgroup(s).