git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Martin Waitz <tali@admingilde.org>
To: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Cc: Jakub Narebski <jnareb@gmail.com>,
	git@vger.kernel.org, Junio C Hamano <junkio@cox.net>
Subject: Re: Subprojects tasks
Date: Mon, 18 Dec 2006 08:44:41 +0100	[thread overview]
Message-ID: <20061218074441.GJ12411@admingilde.org> (raw)
In-Reply-To: <200612180023.45815.Josef.Weidendorfer@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 3475 bytes --]

hoi :)

On Mon, Dec 18, 2006 at 12:23:45AM +0100, Josef Weidendorfer wrote:
> I see that you always use "refs/heads/master" in the submodule.
> What happens if you do development in the submodule, create a new commit
> there, and want to switch supermodule branch afterwards?
> Wouldn't you lose your new work, as "refs/heads/master" has to be reset
> to another commit when you switch the supermodule branch?

It should behave the same as for files:
Refuse to update the working directory if files (or the submodule here)
are dirty.  I guess this is not yet handled correctly by my prototype,
but it should not be hard to do.

> IMHO it would be nice to have refs in the submodule matching all the
> branches/tags of the supermodule.
> Meaning: "this is the commit which is used by branch/tag XYZ in the
> supermodule". This can be valuable information, and a "gitk --all" in
> the submodule would show you all the uses of your subproject in the
> scope of the given superproject.

I like the idea.  Perhaps make them available similiar to the remotes
information in refs/tracked/{heads,tags} or something.

> When switching branches in the supermodule, it simply would switch
> to the same name in submodules.

Nice idea, but I don't yet know how it really works out.
It may be confusing to the user if he manually switches the branch in
the submodule to another branch of the supermodule.  Then he really is
using one tracked branch, but not the currently tracked branch.

> Thus, this would allow to do bug fix commits for a submodule at all
> places where the supermodule has a branch, without the need to switch
> supermodule branches.

Hmm, but when switching to another supermodule branch it would try to
update the submodule branch.
And simply allow the current submodule branch to be a fast forward of
the submodule version that the parent wants to set is a bad, as you
would not be able to go back to an old supermodule version then.

> > > Second, if you want to do some independent work on the module not related
> > > to work on submodule you should really clone (clone -l -s) submodule
> > > and work in separate checkout;
> > 
> > Yes.
> > But I really like the possibility to switch one module to a branch which
> > is not tracked by the parent, because it perhaps contains some debugging
> > code which is needed to debug some other submodule.  You can't move it
> > out because you need the common build infrastructure but you don't want
> > to branch the entire toplevel project because you don't want your
> > debugging changes to ever become visible at that level.
> 
> In general, I agree with not following submodule's HEAD for supermodule
> commits. As you cannot store any submodule branch names, this really
> would be confusing, as after switching to another supermodule branch
> and back again, the submodule branch name would reset to a given name
> ("master" in your current implementation).
> 
> But why wouldn't you create a temporary branch "debug_submodule1" in the
> supermodule for your use case? Branches are cheap with git, even in supermodules.
> Supermodule branches also are pure local, you never have to publish
> it somewhere, and can delete it afterwards.

Sure, you can of course always use supermodule branches.
I just wanted to point out that it still is useful to have submodule
branches which are independent from supermodule branches.

-- 
Martin Waitz

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-12-18  7:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-16 18:32 Subprojects tasks Junio C Hamano
2006-12-16 18:45 ` Jakub Narebski
2006-12-16 23:01   ` Martin Waitz
2006-12-16 23:15     ` Jakub Narebski
2006-12-17  0:01       ` Josef Weidendorfer
2006-12-17 11:45         ` Martin Waitz
2006-12-17 13:01           ` Jakub Narebski
2006-12-17 13:48             ` Martin Waitz
2006-12-17 14:29               ` Jakub Narebski
2006-12-17 19:54                 ` Martin Waitz
2006-12-17 23:27                   ` Josef Weidendorfer
2006-12-18  7:45                     ` Martin Waitz
2006-12-17 23:23               ` Josef Weidendorfer
2006-12-18  7:44                 ` Martin Waitz [this message]
2006-12-18 10:30                   ` Josef Weidendorfer
2006-12-17  0:08       ` Josef Weidendorfer
2006-12-16 20:35 ` Sven Verdoolaege
2006-12-16 21:07   ` Junio C Hamano
2006-12-16 22:58     ` Martin Waitz
2006-12-16 23:14       ` Sven Verdoolaege
2006-12-17  0:32       ` Josef Weidendorfer
2006-12-17  8:48 ` Alan Chandler
2006-12-17 10:01   ` Jakub Narebski
2006-12-17 11:17 ` Martin Waitz

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=20061218074441.GJ12411@admingilde.org \
    --to=tali@admingilde.org \
    --cc=Josef.Weidendorfer@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=junkio@cox.net \
    /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).