Re: [PATCH 6/6] Teach core object handling functions about gitlinks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Martin Waitz
Date: Wednesday, April 11, 2007 - 4:54 pm

hoi :)

On Wed, Apr 11, 2007 at 08:16:10AM -0700, Linus Torvalds wrote:

I fully agree with you about the importance of submodule branches.
In fact, I want to make them even more important and useable!

And by the way, I long forgot about CVS ;-)


=20
e=20
l=20
=20
=20

I fully agree.

e=20
=20
,=20
=20

I fully agree.
You are just so much better in describing things than I am...

e=20
=20
t=20

If you use a detached HEAD then you can no longer switch back to it
once you used some other (independent) branch (for testing or whatever).
This is my main argument: If you just update some 'special'
refs/heads/from-supermodule (or whatever, maybe get it from
=2Egitmodules/config) you can still switch between branches, making them
more useful IMHO.

If we create some other way to easily get to the commit referenced by
the index of the supermodule then a detached HEAD is ok for me, too.
But why create two things (this not-yet-existing way to get the
supermodule index entry, plus submodules HEAD) for the same thing?
Why not simply create a new refs/heads/whatever?
This is easy and everybody knows how to work with it.

s=20
=20
=20

Fully agree.

Please don't confuse my "I always want to use one dedicated branch" with
"I always want to use one special branch from the submodule project".
This refs/heads/whatever I am talking about is _purely_ for ease of
use of the submodule inside the supermodule.  It is in no way linked
to the branchnames that are used by the submodule project.
Well, besides that you can merge back and forth between them, of course.

=20
=20

Fully agree.

=20
=20
=20
l=20
m=20

So you now have this nice "my-integration" branch lying next to other
independent (not-supermodule-related) branches.
If you want to _switch_ to one of these unrelated branches you obviously
have to change HEAD, and suddenly your unrelated branches are
considered to be part of the supermodule (ok, not yet part of its
index of course, but now all supermodule operations would work on
this unrelated branch).

I want to preserve these unrelated branches and see them as a strong
feature.  Branches in submodules should be independent from the
supermodule _because_ the supermodule has no notion of which branch
is used.

=20
=20
=20
=20

Only that you loose your nice detached HEAD view once you start using
those nice branches inside your submodule.

=20
=20
=20
=20

In terms of flexibility it is important what you can do with the
submodule.  Being able to use branches just like in a normal
repository ("switch the branch to go to an other, unrelated branch")
is a plus for me.

A detached HEAD does not give the same level of flexibility as a real
head.


Well, the user explicitly expressed his intent to switch to another
branch!  In a normal repository you are not confused about the working
directory not being in sync with "master", and we always prominently state
which branch you are on.  Of course this has to be clear for submodules,
too.  So if you do git-status in the supermodule it should print some
"submodule is on different branch"-dirty marker.

At least I had some situations where I wanted to use something like
this: use some experimental brach which should not be directly touched
by the supermodule.  Instead provide a method ("git merge
=66rom-supermodule") to sync your working branch with new stuff from
the supermodule.

=20

This is right.  Suddenly we have one more player in the field which
you can diff against.

Before submodules:
tree <-> index <-> working file

submodules always using HEAD:
tree <-> index <-> submodule HEAD <-> submodule working dir

submodules using some dedicated branch:
tree <-> index <-> subm. "from-supermodule" <-> subm. HEAD <-> subm. wd

I haven't thought about which diff really makes sense in which
situation.


--=20
Martin Waitz
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/6] Initial subproject support (RFC?), Linus Torvalds, (Mon Apr 9, 9:12 pm)
[PATCH 3/6] Add 'resolve_gitlink_ref()' helper function, Linus Torvalds, (Mon Apr 9, 9:14 pm)
Re: [PATCH 0/6] Initial subproject support (RFC?), Linus Torvalds, (Mon Apr 9, 9:46 pm)
Re: [PATCH 6/6] Teach core object handling functions about ..., Frank Lichtenheld, (Tue Apr 10, 1:40 am)
Re: [PATCH 0/6] Initial subproject support (RFC?), Alex Riesen, (Tue Apr 10, 6:04 am)
Re: [PATCH 0/6] Initial subproject support (RFC?), Linus Torvalds, (Tue Apr 10, 8:13 am)
Re: [PATCH 0/6] Initial subproject support (RFC?), Alex Riesen, (Tue Apr 10, 8:48 am)
Re: [PATCH 3/6] Add 'resolve_gitlink_ref()' helper function, Josef Weidendorfer, (Tue Apr 10, 8:54 am)
Re: [PATCH 0/6] Initial subproject support (RFC?), Linus Torvalds, (Tue Apr 10, 9:07 am)
Re: [PATCH 6/6] Teach core object handling functions about ..., Josef Weidendorfer, (Tue Apr 10, 9:28 am)
Re: [PATCH 0/6] Initial subproject support (RFC?), Alex Riesen, (Tue Apr 10, 9:43 am)
Re: [PATCH 6/6] Teach core object handling functions about ..., Josef Weidendorfer, (Tue Apr 10, 10:23 am)
Re: [PATCH 6/6] Teach core object handling functions about ..., Josef Weidendorfer, (Tue Apr 10, 12:29 pm)
Re: [PATCH 0/6] Initial subproject support (RFC?), Junio C Hamano, (Tue Apr 10, 12:32 pm)
Re: [PATCH 0/6] Initial subproject support (RFC?), Linus Torvalds, (Tue Apr 10, 1:11 pm)
Re: [PATCH 0/6] Initial subproject support (RFC?), Junio C Hamano, (Tue Apr 10, 1:52 pm)
Re: [PATCH 0/6] Initial subproject support (RFC?), Sam Ravnborg, (Tue Apr 10, 2:02 pm)
Re: [PATCH 0/6] Initial subproject support (RFC?), Nicolas Pitre, (Tue Apr 10, 2:03 pm)
Re: [PATCH 0/6] Initial subproject support (RFC?), Junio C Hamano, (Tue Apr 10, 2:27 pm)
Re: [PATCH 0/6] Initial subproject support (RFC?), Martin Waitz, (Wed Apr 11, 1:32 am)
Re: [PATCH 0/6] Initial subproject support (RFC?), Alex Riesen, (Wed Apr 11, 1:42 am)
Re: [PATCH 0/6] Initial subproject support (RFC?), Martin Waitz, (Wed Apr 11, 1:57 am)
Re: [PATCH 6/6] Teach core object handling functions about ..., Martin Waitz, (Wed Apr 11, 4:54 pm)
Re: [PATCH 6/6] Teach core object handling functions about ..., Josef Weidendorfer, (Thu Apr 12, 8:12 am)
Re: [PATCH 0/6] Initial subproject support (RFC?), J. Bruce Fields, (Sun Apr 15, 4:21 pm)