From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Spencer E. Olson" <olsonse@umich.edu>, git@vger.kernel.org
Subject: Re: [PATCH] submodule: no [--merge|--rebase] when newly cloned
Date: Wed, 16 Feb 2011 21:10:27 +0100 [thread overview]
Message-ID: <4D5C2F33.8020309@web.de> (raw)
In-Reply-To: <7v62sjkbbi.fsf@alter.siamese.dyndns.org>
Am 16.02.2011 20:51, schrieb Junio C Hamano:
> "Spencer E. Olson" <olsonse@umich.edu> writes:
>
>> Previously, when a submodule was cloned in the same command execution, --rebase
>> or --merge would attempt to run (instead of and) before a checkout, resulting in
>> an empty working directory. This patch ignores --rebase or --merge for a
>> particular submodule when that submodule is newly cloned and instead simply
>> checks out the appropriate revision.
>
> Sorry, but I cannot parse the problem description, "(instead of and)" part.
I think what he wanted to say was that after a new submodule is cloned
by running "git submodule update" it will attempt to do a rebase or
merge without having checked out the submodule at all, which obviously
can't work. A plain checkout looks like the right thing to do, as there
aren't any local commits to rebase or merge yet.
> Why is it a better thing to do to ignore these options, instead of
> detecting the situation and error it out, saying "you are initially
> cloning, don't say --rebase"?
It should be fine to use these options when new submodules appear.
(And even without explicitly specifing these command line options
this bug can also be triggered by having the "submodule.<name>.update"
option set in .gitmodules to either "rebase" or "merge", which is easy
to miss)
So this looks like a worthwhile fix. The commit message and POSIX issue
need to be addressed, tests would be a good thing to add too, but apart
from that it looks sane.
next prev parent reply other threads:[~2011-02-16 20:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 12:46 [PATCH] submodule: no [--merge|--rebase] when newly cloned Spencer E. Olson
2011-02-16 19:51 ` Junio C Hamano
2011-02-16 20:10 ` Jens Lehmann [this message]
2011-02-16 21:41 ` Junio C Hamano
2011-02-17 0:21 ` Spencer E. Olson
2011-02-17 7:10 ` Johannes Sixt
2011-02-18 0:34 ` Martin von Zweigbergk
2011-02-18 0:48 ` Spencer E. Olson
2011-02-18 0:59 ` Martin von Zweigbergk
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=4D5C2F33.8020309@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=olsonse@umich.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.