threads / discuss / 11455

[RFH] On a script for submodules

Subject: [RFH] On a script for submodules

## tl;dr

4 messages between Jan 3, 2008 and Jan 6, 2008.

replies: 3people: 2as markdown or json

Imran M Yousuf· Jan 3, 2008, 09:07 UTC · lore
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· Jan 3, 2008, 09:39 UTC · re: Imran M Yousuf · lore

Re: [RFH] On a script for submodules

"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· Jan 3, 2008, 09:52 UTC · re: Junio C Hamano · lore

Re: [RFH] On a script for submodules

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:
Show 14 quoted lines
> "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· Jan 6, 2008, 04:06 UTC · re: Imran M Yousuf · lore

Re: [RFH] On a script for submodules

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:
Show 61 quoted lines
> 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

← back to recent threads