# [RFH] On a script for submodules

4 messages from 2008-01-03 to 2008-01-06. Participants: Imran M Yousuf, Junio C Hamano.
Thread: https://gitlist.dev/t/11455

## Imran M Yousuf, 2008-01-03 09:07

Subject: [RFH] On a script for submodules
Message-ID: <7bfdc29a0801030107t54ca45dbq167666b337f59a01@mail.gmail.com>
URL: https://gitlist.dev/e/7bfdc29a0801030107t54ca45dbq167666b337f59a01%40mail.gmail.com

```
Hi All,

I started writing a script intended for modular (Git modules)
projects. The script can be found at
http://repo.or.cz/w/git-modules-bs.git. This is a very rudimentary
version and I intend to make it more useful for developers who work
with multiple modules. I would also like to mention that I am not an
expert shell scripter thus probably have made several mistakes in the
script; I would really appreciate if someone would take their time to
suggest me improvements. I would also like to get some feedbacks as
what else could be added here. A brief description can be found in the
following posting.

http://imyousuf-tech.blogs.smartitengineering.com/2008/01/propagating-git-commands-to-its.html

Thank you,

-- 
Imran M Yousuf

```

## Junio C Hamano, 2008-01-03 09:39

Subject: Re: [RFH] On a script for submodules
Message-ID: <7vsl1fs0xa.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vsl1fs0xa.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <7bfdc29a0801030107t54ca45dbq167666b337f59a01@mail.gmail.com>

```
"Imran M Yousuf" <imyousuf@gmail.com> writes:

> ... I would really appreciate if someone would take their time to
> suggest me improvements. I would also like to get some feedbacks as
> what else could be added here. A brief description can be found in the
> following posting.

Around here, it is customary to have discussion on-list, not
pointing at external web pages and repositories.  I would
suggest starting by stating what the overall design is and how
it meshes with existing git-submodule command and its design.

```

## Imran M Yousuf, 2008-01-03 09:52

Subject: Re: [RFH] On a script for submodules
Message-ID: <7bfdc29a0801030152t25de6889wc21b9c933f5b9ab9@mail.gmail.com>
URL: https://gitlist.dev/e/7bfdc29a0801030152t25de6889wc21b9c933f5b9ab9%40mail.gmail.com
In-Reply-To: <7vsl1fs0xa.fsf@gitster.siamese.dyndns.org>

```
Hi all,

Sorry for referring to the blog. I am writing the details here again
and also attached the script in the email.

I am fairly a new git user; I started working around with GIT on
Framework development project and I noticed that GIT commands executed
on the parent module is not propagated to the child modules. In some
use cases it would be extremely useful (at least for me) to be able to
be propagate a command from the master module to all its child at all
depth. I wrote the bash shell script (in the attachment) to simply
propagate commands from parent to its child. To use this script one
can simply do the following (I am assuming that the file will have the
name git-modules and will be an executable in $PATH):

    for: git-pull
    do: git-modules pull

    for: git-status
    do: git-modules status

    for: git-commit -a -m "This is a test commit"
    do: git-modules commit -a -m "This is a test commit"

    for: git-checkout master
    do: git-modules checkout master

Basically any git-X command can be simply be done as "git-modules X
args-as-usual".

It is mainly different from the git-submodule command in its usage. I
mainly wrote it to propagate commands. It could be extended for
further usage as well.

I would really appreciate and welcome criticism, feedback and addition
to the script.

Thank you,

On Jan 3, 2008 3:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
> "Imran M Yousuf" <imyousuf@gmail.com> writes:
>
> > ... I would really appreciate if someone would take their time to
> > suggest me improvements. I would also like to get some feedbacks as
> > what else could be added here. A brief description can be found in the
> > following posting.
>
> Around here, it is customary to have discussion on-list, not
> pointing at external web pages and repositories.  I would
> suggest starting by stating what the overall design is and how
> it meshes with existing git-submodule command and its design.
>
>
>



-- 
Imran M Yousuf

```

## Imran M Yousuf, 2008-01-06 04:06

Subject: Re: [RFH] On a script for submodules
Message-ID: <7bfdc29a0801052006g4d01ebc9mfb26f3829fc2a27f@mail.gmail.com>
URL: https://gitlist.dev/e/7bfdc29a0801052006g4d01ebc9mfb26f3829fc2a27f%40mail.gmail.com
In-Reply-To: <7bfdc29a0801030152t25de6889wc21b9c933f5b9ab9@mail.gmail.com>

```
Hi All,

I updated the script to do git submodule init and update if not done
already while recursing; fixed some issues and converted it into sh
script from bash. Hopefully by tomorrow I will be email a merge of
this script with git submodule by adding a recurse command in addition
to the ones existing and also add a parameter --init-submodules to the
git-clone command so that when cloning the git submodule init and git
submodule update is done internally.

I would be grateful if you would kindly provide your feedback.

Best regards,

Imran

On Jan 3, 2008 3:52 PM, Imran M Yousuf <imyousuf@gmail.com> wrote:
> Hi all,
>
> Sorry for referring to the blog. I am writing the details here again
> and also attached the script in the email.
>
> I am fairly a new git user; I started working around with GIT on
> Framework development project and I noticed that GIT commands executed
> on the parent module is not propagated to the child modules. In some
> use cases it would be extremely useful (at least for me) to be able to
> be propagate a command from the master module to all its child at all
> depth. I wrote the bash shell script (in the attachment) to simply
> propagate commands from parent to its child. To use this script one
> can simply do the following (I am assuming that the file will have the
> name git-modules and will be an executable in $PATH):
>
>     for: git-pull
>     do: git-modules pull
>
>     for: git-status
>     do: git-modules status
>
>     for: git-commit -a -m "This is a test commit"
>     do: git-modules commit -a -m "This is a test commit"
>
>     for: git-checkout master
>     do: git-modules checkout master
>
> Basically any git-X command can be simply be done as "git-modules X
> args-as-usual".
>
> It is mainly different from the git-submodule command in its usage. I
> mainly wrote it to propagate commands. It could be extended for
> further usage as well.
>
> I would really appreciate and welcome criticism, feedback and addition
> to the script.
>
> Thank you,
>
> On Jan 3, 2008 3:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> > "Imran M Yousuf" <imyousuf@gmail.com> writes:
> >
> > > ... I would really appreciate if someone would take their time to
> > > suggest me improvements. I would also like to get some feedbacks as
> > > what else could be added here. A brief description can be found in the
> > > following posting.
> >
> > Around here, it is customary to have discussion on-list, not
> > pointing at external web pages and repositories.  I would
> > suggest starting by stating what the overall design is and how
> > it meshes with existing git-submodule command and its design.
> >
> >
> >
>
>
>
> --
> Imran M Yousuf
>



-- 
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran@smartitengineering.com
Mobile: +880-1711402557

```
