* Commit ID of a branch
@ 2010-08-16 21:19 Guillermo
2010-08-16 21:50 ` Ævar Arnfjörð Bjarmason
2010-08-16 23:43 ` Chris Packham
0 siblings, 2 replies; 5+ messages in thread
From: Guillermo @ 2010-08-16 21:19 UTC (permalink / raw)
To: git
Hello,
I want to write a script what checks in all my projects which is the submodule
commit that is registered in every git repo.
Lets say we have the following structure:
project1
- submodule1
project2
- submodule1
I want to find out what file within the .git dir of every project contains the
proper submodule Commit ID that should be checkout with git submodule update.
Regards,
Guillermo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Commit ID of a branch
2010-08-16 21:19 Commit ID of a branch Guillermo
@ 2010-08-16 21:50 ` Ævar Arnfjörð Bjarmason
[not found] ` <AANLkTikD3pmMx1epkp9RdaDBCw3hfVg5RGSCai2UEvaE@mail.gmail.com>
2010-08-16 23:43 ` Chris Packham
1 sibling, 1 reply; 5+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-08-16 21:50 UTC (permalink / raw)
To: Guillermo; +Cc: git
On Mon, Aug 16, 2010 at 21:19, Guillermo <guillermog@tricuspide.com> wrote:
> Hello,
>
> I want to write a script what checks in all my projects which is the submodule
> commit that is registered in every git repo.
>
> Lets say we have the following structure:
>
> project1
> - submodule1
> project2
> - submodule1
>
> I want to find out what file within the .git dir of every project contains the
> proper submodule Commit ID that should be checkout with git submodule update.
That ID is stored in a tree object, See e.g. git-ls-tree for how to get it.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Commit ID of a branch
[not found] ` <AANLkTikD3pmMx1epkp9RdaDBCw3hfVg5RGSCai2UEvaE@mail.gmail.com>
@ 2010-08-16 22:32 ` Guillermo Gonzalez
0 siblings, 0 replies; 5+ messages in thread
From: Guillermo Gonzalez @ 2010-08-16 22:32 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason; +Cc: git
Ooops sorry I just dont seem to understand how to get it.
While Ive user git for two years now.. I just some have limited
understanding of the internals.
Thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Commit ID of a branch
2010-08-16 21:19 Commit ID of a branch Guillermo
2010-08-16 21:50 ` Ævar Arnfjörð Bjarmason
@ 2010-08-16 23:43 ` Chris Packham
2010-08-17 12:35 ` Guillermo Gonzalez
1 sibling, 1 reply; 5+ messages in thread
From: Chris Packham @ 2010-08-16 23:43 UTC (permalink / raw)
To: Guillermo; +Cc: git
On 16/08/10 14:19, Guillermo wrote:
> Hello,
>
> I want to write a script what checks in all my projects which is the submodule
> commit that is registered in every git repo.
>
> Lets say we have the following structure:
>
> project1
> - submodule1
> project2
> - submodule1
>
> I want to find out what file within the .git dir of every project contains the
> proper submodule Commit ID that should be checkout with git submodule update.
>
> Regards,
> Guillermo
If I understand your question correctly, what you want is
git ls-tree HEAD submodule1
Which will give you the sha1 of the commit in the submodule your project
should be pointing to. We use this in various scripts at work.
It is also possible to get this information (and more) from a slightly
friendlier submodule command if you want it for non-script usage.
git submodule status
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Commit ID of a branch
2010-08-16 23:43 ` Chris Packham
@ 2010-08-17 12:35 ` Guillermo Gonzalez
0 siblings, 0 replies; 5+ messages in thread
From: Guillermo Gonzalez @ 2010-08-17 12:35 UTC (permalink / raw)
To: Chris Packham; +Cc: git
Thank you!
On 17 August 2010 01:43, Chris Packham <judge.packham@gmail.com> wrote:
> On 16/08/10 14:19, Guillermo wrote:
>> Hello,
>>
>> I want to write a script what checks in all my projects which is the submodule
>> commit that is registered in every git repo.
>>
>> Lets say we have the following structure:
>>
>> project1
>> - submodule1
>> project2
>> - submodule1
>>
>> I want to find out what file within the .git dir of every project contains the
>> proper submodule Commit ID that should be checkout with git submodule update.
>>
>> Regards,
>> Guillermo
>
> If I understand your question correctly, what you want is
>
> git ls-tree HEAD submodule1
>
> Which will give you the sha1 of the commit in the submodule your project
> should be pointing to. We use this in various scripts at work.
>
> It is also possible to get this information (and more) from a slightly
> friendlier submodule command if you want it for non-script usage.
>
> git submodule status
>
--
Guillermo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-08-17 12:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-16 21:19 Commit ID of a branch Guillermo
2010-08-16 21:50 ` Ævar Arnfjörð Bjarmason
[not found] ` <AANLkTikD3pmMx1epkp9RdaDBCw3hfVg5RGSCai2UEvaE@mail.gmail.com>
2010-08-16 22:32 ` Guillermo Gonzalez
2010-08-16 23:43 ` Chris Packham
2010-08-17 12:35 ` Guillermo Gonzalez
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).