threads / discuss / 6500

Remote git-describe ?

Subject: Remote git-describe ?

## tl;dr

11 messages between Jan 24, 2007 and Jan 24, 2007.

replies: 10people: 6as markdown or json

Johannes Schindelin· Jan 24, 2007, 11:03 UTC · re: Francis Moreau · lore

Re: Remote git-describe ?

Hi,
On Wed, 24 Jan 2007, Francis Moreau wrote:
> I'm looking for a command that would give the same output than 'git
> describe' but on a remote server.
> 
> Is this possible ?

It would be possible; at a high cost (especially on the remote server): You definitely need _all_ commits between the commit you want to describe and the tag it eventually finds, and possibly all other commits, too.

So it boils down to fetching all commit objects. It is much cheaper, and more efficient, to just fetch the repo and do it locally.

Hth, Dscho

Francis Moreau· Jan 24, 2007, 11:13 UTC · re: Johannes Schindelin · lore

Re: Remote git-describe ?

On 1/24/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 16 quoted lines
> Hi,
>
> On Wed, 24 Jan 2007, Francis Moreau wrote:
>
> > I'm looking for a command that would give the same output than 'git
> > describe' but on a remote server.
> >
> > Is this possible ?
>
> It would be possible; at a high cost (especially on the remote server):
> You definitely need _all_ commits between the commit you want to describe
> and the tag it eventually finds, and possibly all other commits, too.
>
> So it boils down to fetching all commit objects. It is much cheaper, and
> more efficient, to just fetch the repo and do it locally.
>
really ? Givinig that I would use it to describe the HEAD of the kernel repo:
        $ git describe --remote=<git-server> HEAD

this would make the server parse all commits between HEAD and the closest tag which seems to me a lot cheaper than downloading the whole repo...

-- 
Francis
Johannes Schindelin· Jan 24, 2007, 11:29 UTC · re: Francis Moreau · lore

Re: Remote git-describe ?

Hi,
On Wed, 24 Jan 2007, Francis Moreau wrote:
Show 26 quoted lines
> On 1/24/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > Hi,
> > 
> > On Wed, 24 Jan 2007, Francis Moreau wrote:
> > 
> > > I'm looking for a command that would give the same output than 'git
> > > describe' but on a remote server.
> > >
> > > Is this possible ?
> > 
> > It would be possible; at a high cost (especially on the remote server):
> > You definitely need _all_ commits between the commit you want to describe
> > and the tag it eventually finds, and possibly all other commits, too.
> > 
> > So it boils down to fetching all commit objects. It is much cheaper, and
> > more efficient, to just fetch the repo and do it locally.
> > 
> 
> really ? Givinig that I would use it to describe the HEAD of the kernel 
> repo:
> 
>        $ git describe --remote=<git-server> HEAD
> 
> this would make the server parse all commits between HEAD and the 
> closest tag which seems to me a lot cheaper than downloading the whole 
> repo...

The problem is that you don't know which tag is closest. You _have_ to walk the ancestry to find out.

Besides, it has been determined that the commit objects _alone_ make up quite a substantial part of the repo, so downloading them _is_ similar to downloading the whole repo.

Ciao, Dscho

Junio C Hamano· Jan 24, 2007, 12:21 UTC · re: Francis Moreau · lore

Re: Remote git-describe ?

"Francis Moreau" <francis.moro@gmail.com> writes:
Show 7 quoted lines
> ... Givinig that I would use it to describe the HEAD of the kernel repo:
>
>        $ git describe --remote=<git-server> HEAD
>
> this would make the server parse all commits between HEAD and the
> closest tag which seems to me a lot cheaper than downloading the whole
> repo...

Do you mean you want to have the server describe the HEAD the server side has (not the HEAD in your repository)? Why?

I suspect the real motivation of your question lies elsewhere and not in "describe".

Suppose we had such a service on the server side, and you asked the server twice and got these (at different times, of course):

	v2.6.20-rc5-g419dd83
	v2.6.20-rc5-gde14569
What useful information can you get between the two?  
Nothing.

The commit object names are like random numbers and 419dd83 may or may not be older than de14569. The "hash" part of the output is meaningless for you until you actually have the history to poke at with "git log", "git diff" and friends.

Another request might give you this:
	v2.6.20-rc6

At least, between this one and the previous two, you have a little bit of information that you can use: "Ah, another development phase."

So I suspect what you are after is not about using describe remotely or describing where the HEAD is; you want to know if there is a new tag near the tip since the last time you checked.

If that is the case, "git-ls-remote --tags" is probably what you want.

Junio C Hamano· Jan 24, 2007, 12:34 UTC · re: Junio C Hamano · lore

Re: Remote git-describe ?

Junio C Hamano <junkio@cox.net> writes:
Show 14 quoted lines
> Suppose we had such a service on the server side, and you asked
> the server twice and got these (at different times, of course):
>
> 	v2.6.20-rc5-g419dd83
> 	v2.6.20-rc5-gde14569
>
> What useful information can you get between the two?  
>
> Nothing.
>
> The commit object names are like random numbers and 419dd83 may
> or may not be older than de14569.  The "hash" part of the
> output is meaningless for you until you actually have the
> history to poke at with "git log", "git diff" and friends.
Side note.

Also the commit object names (hence "describe" output) do not tell you how far they are from the tag used to describe them.

However, I suspect that we could do better with Shawn's new fangled describe implementation that actually counts the distance between what is described and the tag. We could add "number of commits since the tag" somewhere, to describe:

	v2.6.20-rc5-256-g419dd83
        v2.6.20-rc5-217-gde14569

to say that the first one has 256 commits accumulated since the given tag "v2.6.20-rc5" and the second one has only 217 commits, to get the sense of how busy the development activity is.

Is it useful?  That is something I am not sure.
Side note for side note.

This should be obvious to people who know git, but the above does not mean we can remove gXXXX part from the describe output, becauses there could be infinite number of commits that are 256 commits away from v2.6.20-rc5 tag. v2.6.20-rc5-256 alone does not uniquely identify the commit 419dd83.

Santi Béjar· Jan 24, 2007, 13:01 UTC · re: Junio C Hamano · lore

Re: Remote git-describe ?

On 1/24/07, Junio C Hamano <junkio@cox.net> wrote:
Show 17 quoted lines
> Also the commit object names (hence "describe" output) do not
> tell you how far they are from the tag used to describe them.
>
> However, I suspect that we could do better with Shawn's new
> fangled describe implementation that actually counts the
> distance between what is described and the tag.  We could add
> "number of commits since the tag" somewhere, to describe:
>
>         v2.6.20-rc5-256-g419dd83
>         v2.6.20-rc5-217-gde14569
>
> to say that the first one has 256 commits accumulated since the
> given tag "v2.6.20-rc5" and the second one has only 217
> commits, to get the sense of how busy the development activity
> is.
>
> Is it useful?  That is something I am not sure.

I find it usefull. I even suggested it in November: http://marc.theaimsgroup.com/?l=git&m=116246596012422&w=2

Quote: One problem I see with this scheme (either 'g', 'git' of '+') is that it does not provide an increasing version number, even for fast-forwarding commits. Then it is not useful as a package version number (deb or rpm). I've already seen deb packages with version+git20061010. End Quote:

The "either 'g',..." was something it that thread, but applies to the current scheme.

Santi
Show 15 quoted lines
>
> Side note for side note.
>
> This should be obvious to people who know git, but the above
> does not mean we can remove gXXXX part from the describe output,
> becauses there could be infinite number of commits that are 256
> commits away from v2.6.20-rc5 tag.  v2.6.20-rc5-256 alone does
> not uniquely identify the commit 419dd83.
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Johannes Schindelin· Jan 24, 2007, 13:57 UTC · re: Junio C Hamano · lore

Re: Remote git-describe ?

Hi,
On Wed, 24 Jan 2007, Junio C Hamano wrote:
> This should be obvious to people who know git, but the above
> does not mean we can remove gXXXX part from the describe output,
> becauses there could be infinite number of commits that are 256
> commits away from v2.6.20-rc5 tag.
This is only completely true if "infinite" is smaller than 2^160...
;-)

Ciao, Dscho

Simon 'corecode' Schubert· Jan 24, 2007, 14:28 UTC · re: Johannes Schindelin · lore

Re: Remote git-describe ?

Johannes Schindelin wrote:
Show 5 quoted lines
>> This should be obvious to people who know git, but the above
>> does not mean we can remove gXXXX part from the describe output,
>> becauses there could be infinite number of commits that are 256
>> commits away from v2.6.20-rc5 tag.
> This is only completely true if "infinite" is smaller than 2^160...
actually not.  you can have more, but then even the hash isn't unique anymore.  oh no!
cheers
  simon
-- 
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Nicolas Pitre· Jan 24, 2007, 15:23 UTC · re: Junio C Hamano · lore

Re: Remote git-describe ?

On Wed, 24 Jan 2007, Junio C Hamano wrote:
Show 14 quoted lines
> However, I suspect that we could do better with Shawn's new
> fangled describe implementation that actually counts the
> distance between what is described and the tag.  We could add
> "number of commits since the tag" somewhere, to describe:
> 
> 	v2.6.20-rc5-256-g419dd83
>         v2.6.20-rc5-217-gde14569
> 
> to say that the first one has 256 commits accumulated since the
> given tag "v2.6.20-rc5" and the second one has only 217
> commits, to get the sense of how busy the development activity
> is.
> 
> Is it useful?  That is something I am not sure.
I think this would be really nice to have even if not absolutely useful.
Nicolas
Francis Moreau· Jan 24, 2007, 12:50 UTC · re: Junio C Hamano · lore

Re: Remote git-describe ?

Junio C Hamano wrote:
Show 13 quoted lines
> "Francis Moreau" <francis.moro@gmail.com> writes:
>
>> ... Givinig that I would use it to describe the HEAD of the kernel repo:
>>
>>        $ git describe --remote=<git-server> HEAD
>>
>> this would make the server parse all commits between HEAD and the
>> closest tag which seems to me a lot cheaper than downloading the whole
>> repo...
>
> Do you mean you want to have the server describe the HEAD the
> server side has (not the HEAD in your repository)?  Why?
>
yes. see below...
Show 13 quoted lines
> I suspect the real motivation of your question lies elsewhere
> and not in "describe".
>
> Suppose we had such a service on the server side, and you asked
> the server twice and got these (at different times, of course):
>
> 	v2.6.20-rc5-g419dd83
> 	v2.6.20-rc5-gde14569
>
> What useful information can you get between the two?
>
> Nothing.
>
I agree in the context I gave, it's useless.
Show 5 quoted lines
>
> So I suspect what you are after is not about using describe
> remotely or describing where the HEAD is; you want to know if
> there is a new tag near the tip since the last time you checked.
>

Actually I'd like to generate an archive from a git server. And I want to give the name of the archive file, the ouptut given by 'git describe'.

Since I can pass --remote to 'git archive', I do not need anymore to clone the repo before generating the archive. But I still needs it only to run 'git describe' thus my question...

thanks
-- 
Francis

← back to recent threads