From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <junkio@cox.net>
Cc: Lars Hjemli <hjemli@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
git@vger.kernel.org
Subject: Re: [PATCH] Add git-submodule command
Date: Sat, 26 May 2007 11:42:01 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0705261136590.4648@racer.site> (raw)
In-Reply-To: <7v1wh4ped4.fsf@assigned-by-dhcp.cox.net>
Hi,
On Fri, 25 May 2007, Junio C Hamano wrote:
> Lars Hjemli <hjemli@gmail.com> writes:
>
> > +
> > +#
> > +# Run clone + checkout on missing submodules
> > +#
> > +# $@ = requested paths (default to all)
> > +#
> > +modules_init()
> > +{
> > + git ls-files --stage -- $@ | grep -e '^160000 ' |
>
> Did you mean "$@", i.e. inside double-quotes?
>
> Because this pattern would appear a lot in superproject support,
> it might be a good idea to give a new option, --subprojects, to
> git-ls-files to limit its output to 160000 entries, but that is
> a minor detail.
I think that makes sense. It would also help the next one:
>
> > + while read mode sha1 stage path
> > + do
>
> We would need to undo the shell-safety "quoted" output of paths
> here. I suspect it would be much easier to code this in Perl or
> Python, do the "grep -e" part above in the script, when we start
> caring about unwrapping c-quoting of path (or "ls-files -z").
I would prefer this to be in shell... so to be easier make it a builtin
later, when the script has evolved into a stable state. By introducing
--subprojects to git-ls-files, you can roll your own quoting just for
git-submodule, as needed.
> But that is a minor detail we could fix up later.
I agree. It makes for a nice incremental patch.
> > + test -d "$path/.git" && continue
> > +
> > + if test -d "$path"
> > + then
> > + rmdir "$path" 2>/dev/null ||
> > + die "Directory '$path' exist, but not as a submodule"
> > + fi
>
> Could the currently checked-out $path be a symlink to another
> directory, and what does the code do in such a case?
I am not quite sure if you should allow that... So, IMHO this is stuff to
discuss after the initial revision (and after we have a test case, so we
can play around with symlinks safely).
Ciao,
Dscho
next prev parent reply other threads:[~2007-05-26 10:42 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-25 9:51 [PATCH] Add git-submodule command Lars Hjemli
2007-05-25 10:57 ` Johannes Schindelin
2007-05-25 12:24 ` Johannes Schindelin
2007-05-25 13:46 ` Lars Hjemli
2007-05-25 13:58 ` Johannes Schindelin
2007-05-25 14:16 ` Lars Hjemli
2007-05-25 14:47 ` Johannes Schindelin
2007-05-25 14:52 ` Lars Hjemli
2007-05-25 18:09 ` Lars Hjemli
2007-05-25 18:41 ` Johannes Schindelin
2007-05-25 19:31 ` Junio C Hamano
2007-05-25 20:29 ` Lars Hjemli
2007-05-25 20:52 ` Junio C Hamano
2007-05-25 22:01 ` Lars Hjemli
2007-05-26 0:17 ` Lars Hjemli
2007-05-26 0:48 ` Johannes Schindelin
2007-05-26 1:23 ` Junio C Hamano
2007-05-26 9:39 ` Lars Hjemli
2007-05-26 10:42 ` Johannes Schindelin [this message]
2007-05-26 13:56 ` Lars Hjemli
2007-05-26 14:37 ` Simon Hausmann
2007-05-26 14:48 ` Lars Hjemli
2007-05-25 20:30 ` Johannes Schindelin
2007-05-25 19:57 ` Linus Torvalds
2007-05-25 20:28 ` Johannes Schindelin
2007-05-25 22:33 ` Lars Hjemli
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=Pine.LNX.4.64.0705261136590.4648@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=hjemli@gmail.com \
--cc=junkio@cox.net \
--cc=torvalds@linux-foundation.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).