git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: GIT <git@vger.kernel.org>,
	iveqy@iveqy.com, stefan.naewe@atlas-elektronik.com,
	hvoigt@hvoigt.net, Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC/PATCHv3] submodule update: allow custom update command
Date: Wed, 3 Jul 2013 11:26:13 +1200	[thread overview]
Message-ID: <CAFOYHZC1xMt2eqaNm0vtLVJ3X2TNjRxa3sEjBPmHVeHrQmSc4A@mail.gmail.com> (raw)
In-Reply-To: <51D3064C.80901@web.de>

On Wed, Jul 3, 2013 at 4:56 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
> Am 02.07.2013 12:12, schrieb Chris Packham:
>> --- a/Documentation/git-submodule.txt
>> +++ b/Documentation/git-submodule.txt
>> @@ -159,7 +159,9 @@ update::
>>       This will make the submodules HEAD be detached unless `--rebase` or
>>       `--merge` is specified or the key `submodule.$name.update` is set to
>>       `rebase`, `merge` or `none`. `none` can be overridden by specifying
>> -     `--checkout`.
>> +     `--checkout`. Setting the key `submodule.$name.update` to `!command`
>> +     will cause `command` to be run. `command` can be any arbitrary shell
>> +     command that takes a single argument, namely the sha1 to update to.
>>  +
>>  If the submodule is not yet initialized, and you just want to use the
>>  setting as stored in .gitmodules, you can automatically initialize the
>> @@ -172,6 +174,7 @@ If `--force` is specified, the submodule will be checked out (using
>>  `git checkout --force` if appropriate), even if the commit specified in the
>>  index of the containing repository already matches the commit checked out in
>>  the submodule.
>> ++
>>
>>  summary::
>>       Show commit summary between the given commit (defaults to HEAD) and
>
> I'm not sure this change is necessary ;-)
>

Not necessary because it should be documented in
Documentation/config.txt instead, or not necessary because it's a
niche feature that doesn't need to be advertised?

>> diff --git a/git-submodule.sh b/git-submodule.sh
>> index eb58c8e..a7c2375 100755
>> --- a/git-submodule.sh
>> +++ b/git-submodule.sh
>> @@ -799,6 +799,12 @@ Maybe you want to use 'update --init'?")"
>>                               say_msg="$(eval_gettext "Submodule path '\$prefix\$sm_path': merged in '\$sha1'")"
>>                               must_die_on_failure=yes
>>                               ;;
>> +                     !*)
>> +                             command="${update_module#!}"
>> +                             die_msg="$(eval_gettext "Unable to exec '\$command \$sha1' in submodule path '\$prefix\$sm_path'")"
>
> Hmm, "Unable to exec" does not quite cut it, as the command was executed
> but returned an error, right? Maybe something like this:
>
>    Execution of '\$command \$sha1' failed in submodule  path '\$prefix\$sm_path'
>

Will include in v4 once I write some tests.

  reply	other threads:[~2013-07-02 23:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28  9:53 [RFC/PATCH] submodule: add 'exec' option to submodule update Chris Packham
2013-06-28 10:13 ` Stefan Näwe
2013-06-28 10:42 ` Fredrik Gustafsson
2013-06-29  9:11   ` Chris Packham
2013-06-30 15:30     ` Jens Lehmann
2013-07-01  9:21       ` Chris Packham
2013-07-01 10:11       ` [RFC/PATCHv2] submodule: add ability to configure update command Chris Packham
2013-07-01 16:26         ` Junio C Hamano
2013-07-02 10:12           ` [RFC/PATCHv3] submodule update: allow custom " Chris Packham
2013-07-02 16:56             ` Jens Lehmann
2013-07-02 23:26               ` Chris Packham [this message]
2013-07-03  6:55                 ` Jens Lehmann
2013-07-03  7:54                   ` Chris Packham
2013-07-03  8:50                     ` Chris Packham
2013-07-03 17:09                       ` Junio C Hamano
2013-07-03  9:02               ` [RFC/PATCHv4] " Chris Packham
2013-07-03 17:17                 ` Junio C Hamano
2013-07-01 16:48         ` [RFC/PATCHv2] submodule: add ability to configure " Junio C Hamano
2013-07-02  9:59           ` Chris Packham

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=CAFOYHZC1xMt2eqaNm0vtLVJ3X2TNjRxa3sEjBPmHVeHrQmSc4A@mail.gmail.com \
    --to=judge.packham@gmail.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=iveqy@iveqy.com \
    --cc=stefan.naewe@atlas-elektronik.com \
    /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).