# When to run git-update-server-info

2 messages from 2007-02-13 to 2007-02-13. Participants: Pavel Roskin, Junio C Hamano.
Thread: https://gitlist.dev/t/6792

## Pavel Roskin, 2007-02-13 04:49

Subject: When to run git-update-server-info
Message-ID: <1171342189.2326.68.camel@dv>
URL: https://gitlist.dev/e/1171342189.2326.68.camel%40dv

```
Hello!

It looks like that either the documentation is misleading or git is not
working as promised.

Documentation/repository-layout.txt says:

info/refs::
        This file is to help dumb transports to discover what
        refs are available in this repository.  Whenever you
        create/delete a new branch or a new tag, `git
        update-server-info` should be run to keep this file
        up-to-date if the repository is published for dumb
        transports.  The `git-receive-pack` command, which is
        run on a remote repository when you `git push` into it,
        runs `hooks/update` hook to help you achieve this.

My understanding of the above text is that git-update-server-info only
needs to be run if a new branch or tag is created, not on every
git-push.  Just because hooks/update is run on every push, it doesn't
mean that it needs to be done every time.

What happens in reality is that git-pull refuses to pull new revisions
from the repository if git-update-server-info is not run after a simple
git-push (from another repository, of course) that didn't create any
branch or tag.  However, git-clone would load all revisions.  I'm
accessing the repository over http.

The problem it, there is more than one way to get the branch revisions,
one is from info/refs and the other is from individual files under
refs/heads and refs/tags.  Using database terms, the git repository in
not normalized, so we get an update anomaly.

I understand that accessing one file could be faster over http, so I
tend to think that it's the documentation needs to be fixed.  If that's
the case, maybe hooks/update should be created executable by default?

Alternatively, git-update-server-info functionality could be embedded
into git-receive-pack to simplify server setup.

-- 
Regards,
Pavel Roskin

```

## Junio C Hamano, 2007-02-13 05:20

Subject: Re: When to run git-update-server-info
Message-ID: <7vps8e3a6j.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vps8e3a6j.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <1171342189.2326.68.camel@dv>

```
Pavel Roskin <proski@gnu.org> writes:

> Hello!
>
> It looks like that either the documentation is misleading or git is not
> working as promised.
>
> Documentation/repository-layout.txt says:
>
> info/refs::
>         This file is to help dumb transports to discover what
>         refs are available in this repository.  Whenever you
>         create/delete a new branch or a new tag, `git
>         update-server-info` should be run to keep this file
>         up-to-date if the repository is published for dumb
>         transports.  The `git-receive-pack` command, which is
>         run on a remote repository when you `git push` into it,
>         runs `hooks/update` hook to help you achieve this.
>
> My understanding of the above text is that git-update-server-info only
> needs to be run if a new branch or tag is created, not on every
> git-push.  Just because hooks/update is run on every push, it doesn't
> mean that it needs to be done every time.

I agree the above can be interpreted as such, and documentation
updates is needed.  The information in info/refs are used in
full, not just the list of ref names on the far right of each
line but also the object name at the beginning of each line.

> I understand that accessing one file could be faster over http, so I
> tend to think that it's the documentation needs to be fixed.  If that's
> the case, maybe hooks/update should be created executable by default?

The repository that serve things over http are _minorities_, so
I do not think that is a good idea.

```
