git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Git Mailing List <git@vger.kernel.org>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	Paul Mackerras <paulus@samba.org>,
	Heiko Voigt <hvoigt@hvoigt.net>, Lars Hjemli <hjemli@gmail.com>,
	Avery Pennarun <apenwarr@gmail.com>
Subject: Re: submodules' shortcomings, was Re: RFC: display dirty submodule working directory in git gui and gitk
Date: Tue, 05 Jan 2010 21:01:10 +0100	[thread overview]
Message-ID: <4B439A86.3020500@web.de> (raw)
In-Reply-To: <7vd41oz9mp.fsf@alter.siamese.dyndns.org>

Am 05.01.2010 19:31, schrieb Junio C Hamano:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
>>   b) new unignored files
>>      IMO these files should show up too (the superproject doesn't show
>>      ignored files, the submodule state shouldn't do that either). But
>>      OTOH i don't see a possibility for loss of data when this state is
>>      not shown.
> 
> I don't know if we are talking about the same scenario.  What I had in
> mind was:
> 
>     cd sub
>     edit new-file
>     tests ok and be happy
>     git commit
>     cd ..
>     git status
>     git commit
> 
> forgetting that only you have sub/new-file in the world.  It is not loss
> of data, but still bad.  Forgetting to add a new-file and committing in a
> project without submodule doesn't lose data, but the resulting commit will
> be seen as broken by other people.

I'm not quite sure, i was rather thinking about something like this:

    cd sub
    edit new-file
    cd ..
    <use sub/new-file here, test ok and be happy>
    git status
    git commit
    git push

git status won't show you that sub has any new files and so you won't be
reminded that you still have to add, commit and push it in the submodule
before you should even commit, let alone push in the superproject.

It is a possible breakage for other people if sub/new-file stays unnoticed.
That's IMO a good point for showing these files too.


>>   c) a detached HEAD not on any local *or* remote branch
>>      This can be fatal when doing a reset, revert or checkout, so it
>>      should be shown. Alternatively when applied on a submodule, forcing
>>      could be disabled to let the command fail instead of throwing stuff
>>      away.
> 
> Sorry, I am lost.  Are you worried about "reset/revert/checkout" in the
> superproject?  What destructive things do these operations do that you
> consider "fatal"?  I am especially puzzled by "revert", as "commit",
> "cherry-pick", and "merge" would have the same "fatal" effect as "revert",
> but I don't get what "fatality" you are talking about here.

Sorry, that was an incomplete description on my part.

My mind had already been warped into in the - hopefully not too distant -
future where these commands will be able to recurse into submodules too
(I ran into this issue recently while trying to teach git gui to revert
submodules). Right now we are blind for this state of the submodule unless
you go inside and use "git status" and friends there. And if you use e.g.
"git reset --hard" there, you can loose the commits on HEAD which aren't
on any branch.


>>   d) a detached HEAD not on any remote branch
>>      AFAICS this is only important for a push, and could just error out
>>      there.
> 
> Likewise.

This can be bad in the same way that new unignored files can be (and
there is no time travel involved this time ;-). With HEAD i meant the
submodule commit committed and about to be pushed in the supermodule
(which happens to be the HEAD of the submodule most of the time, but
not always). So you committed sub/new-file but didn't push it anywhere.
This can lead to breakage for other people even with current git. I
think push could check for this and error out, as pushing out a
referenced submodule commit which is not pushed anywhere makes no sense.

But right now i don't believe we would have to show that in the output
of git diff-files and git status, because it is only relevant at the
time when you actually want to push the superproject.


>> Yes, we can leave it that way for now (first "clone" and then "submodule
>> init <the submodules you need>"). We can migrate to the "group mapping"
>> functionality later (which would then allow to force certain submodules
>> to always be populated because they appear in every group).
> 
> Even with group mapping, you need to clone the superproject first, before
> seeing the mapping (which I would assume comes in the superproject).  And
> you need to see the mapping to decide what group you belong to.  After
> that you can finally drive sub-clone to continue (e.g. I work in the
> documentation area, and the group mapping has 'docs' that lets me pull in
> submodules for doc/ and common/ directories, without src/ submodule --- I
> can only learn that the submodules I am interested in are called 'docs' by
> group name or doc/ and common/ subdirectories _after_ I get the clone of
> the superproject).

I think we agree here.

  reply	other threads:[~2010-01-05 20:01 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-02 15:33 RFC: display dirty submodule working directory in git gui and gitk Jens Lehmann
2010-01-04  9:44 ` Johannes Schindelin
2010-01-04 10:44   ` Heiko Voigt
2010-01-04 11:46     ` submodules, was " Johannes Schindelin
2010-01-04 18:29       ` Avery Pennarun
2010-01-04 19:14         ` Jens Lehmann
2010-01-04 17:04   ` Jens Lehmann
2010-01-04 22:29     ` submodules' shortcomings, was " Johannes Schindelin
2010-01-04 22:27       ` Shawn O. Pearce
2010-01-04 22:35         ` Avery Pennarun
2010-01-04 22:53       ` Avery Pennarun
2010-01-05  8:11       ` Jens Lehmann
2010-01-05  9:33         ` Junio C Hamano
2010-01-05 10:07           ` Johannes Schindelin
2010-01-05 11:57           ` Jens Lehmann
2010-01-05 18:31             ` Junio C Hamano
2010-01-05 20:01               ` Jens Lehmann [this message]
2010-01-06  1:04                 ` Junio C Hamano
2010-01-06 14:05                   ` Jens Lehmann
2010-01-06 17:01                     ` Junio C Hamano
2010-01-06 17:23                       ` Nguyen Thai Ngoc Duy
2010-01-06 17:55                         ` Junio C Hamano
2010-01-06 18:22                           ` Nguyen Thai Ngoc Duy
2010-01-06 18:32                           ` Jens Lehmann
2010-01-06 20:01                             ` Junio C Hamano
2010-01-06 21:19                               ` Jens Lehmann
2010-01-06 18:20                       ` Jens Lehmann
2010-01-05 23:02               ` Johannes Schindelin
2010-01-05  9:46         ` Johannes Schindelin
2010-01-05 12:19           ` Jens Lehmann
2010-01-05 14:27           ` Heiko Voigt
2010-01-05 15:07             ` Johan Herland
2010-01-05 15:30             ` Johannes Schindelin
2010-01-05 22:37             ` Nanako Shiraishi
2010-01-05 23:13               ` Johannes Schindelin
2010-01-07 11:04                 ` Nanako Shiraishi
2010-01-05 20:38       ` Pau Garcia i Quiles
2010-01-05 23:06         ` cmake, was Re: submodules' shortcomings Johannes Schindelin
2010-01-06  1:17           ` Pau Garcia i Quiles
2010-01-06  4:25             ` Miles Bader
2010-01-06  9:24             ` Johannes Schindelin
2010-01-04 17:51   ` RFC: display dirty submodule working directory in git gui and gitk Nguyen Thai Ngoc Duy
2010-01-04 18:40     ` Jens Lehmann
2010-01-04 19:05       ` Junio C Hamano
2010-01-04 19:21         ` Jens Lehmann

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=4B439A86.3020500@web.de \
    --to=jens.lehmann@web.de \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hjemli@gmail.com \
    --cc=hvoigt@hvoigt.net \
    --cc=paulus@samba.org \
    --cc=spearce@spearce.org \
    /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).