git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Lars Hjemli <hjemli@gmail.com>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org, "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
Subject: Re: [RFC/PATCH v3 3/3] archive.c: add basic support for submodules
Date: Fri, 23 Jan 2009 12:50:55 -0800	[thread overview]
Message-ID: <7vljt1u4pc.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <8c5c35580901231215q2be36abbla443975cdbb031f0@mail.gmail.com> (Lars Hjemli's message of "Fri, 23 Jan 2009 21:15:16 +0100")

Lars Hjemli <hjemli@gmail.com> writes:

> On Fri, Jan 23, 2009 at 20:23, Junio C Hamano <gitster@pobox.com> wrote:
>> Lars Hjemli <hjemli@gmail.com> writes:
>>
>>>>> The plan is to fix these limitations by extending --submodules to allow
>>>>> certain flags/options:
>>>>> a|c|r     include any|checked out|registered submodules
>>>>> H         resolve submodule HEAD to decide which tree to include
>>
>> What do you mean by "decide"?  If HEAD exists (iow, the submodule is
>> checked out), the tree of the commit recorded in the superproject's
>> gitlink entry is included in the result?
>
> No, when H is specified the tree of the currently checked out
> submodule commit would be included.

That makes even less sense.  At that point you are mixing a tree with
random state from a work tree, and doing so only for submodules.  If you
want a work tree snapshot, it should be a work tree snapshot, and should
not be labelled as a snapshot out of a tree object of the superproject.

> I would find the H flag practical for my own usage of submodules. I
> almost never modify the content of the currently checked out submodule
> but I often check out a different HEAD than what is registered in the
> gitlink in the superproject (typically due to testing the superproject
> against different versions of the submodule). And for such a use case,
> being able to create a tarball of my currently checked out state seems
> useful to me.

That would be more like an enhanced version of "git archive" that takes
the work tree state, similar to how "git grep" operates on the work tree
today.

I agree that would be useful, but I have a moderately strong suspition
that your "H" hack that includes the work tree state for checked out
submodules into a view that is primarily about the "tree" object in the
superproject, without the same "take from the work tree" semantics for
paths in the superproject, is more harmful than being helpful to the users
in the longer term.  It might be simple to implement, but I do not think
its semantics can be explained sanely.

  reply	other threads:[~2009-01-23 20:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 21:17 [RFC/PATCH v3 0/3] Add support for `git archive --submodules` Lars Hjemli
2009-01-22 21:17 ` [RFC/PATCH v3 1/3] tree.c: teach read_tree_recursive how to traverse gitlink entries Lars Hjemli
2009-01-22 21:17   ` [RFC/PATCH v3 2/3] sha1_file: prepare for adding alternates on demand Lars Hjemli
2009-01-22 21:17     ` [RFC/PATCH v3 3/3] archive.c: add basic support for submodules Lars Hjemli
2009-01-22 23:44       ` Johannes Schindelin
2009-01-23 18:40         ` Lars Hjemli
2009-01-23 19:23           ` Junio C Hamano
2009-01-23 20:15             ` Lars Hjemli
2009-01-23 20:50               ` Junio C Hamano [this message]
2009-01-23 21:15                 ` Lars Hjemli
2009-01-23 19:57           ` Johannes Schindelin
2009-01-24  8:44             ` Lars Hjemli
2009-01-24 13:51               ` Johannes Schindelin
2009-01-24 19:26                 ` Lars Hjemli
2009-01-24 19:52                   ` Johannes Schindelin
2009-01-24 20:02                     ` Lars Hjemli
2009-01-22 23:43     ` [RFC/PATCH v3 2/3] sha1_file: prepare for adding alternates on demand Johannes Schindelin
2009-01-23 18:35       ` Lars Hjemli
2009-01-23 19:54         ` Johannes Schindelin

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=7vljt1u4pc.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=hjemli@gmail.com \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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).