threads / discuss / 12470

git-relink doesn't work on bare repos

Subject: git-relink doesn't work on bare repos

## tl;dr

5 messages between Mar 4, 2008 and Mar 4, 2008.

replies: 4people: 3as markdown or json

John Goerzen· Mar 4, 2008, 00:29 UTC · lore
If I try to point git-relink at a bare repo, I get:
Usage: /usr/bin/git-relink [--safe] <dir> [<dir> ...] <master_dir>
All directories should contain a .git/objects/ subdirectory.
In my case, both master_dir and the CWD are bare repos.
This is 1.5.4.2
Sean· Mar 4, 2008, 07:09 UTC · re: John Goerzen · lore

Re: git-relink doesn't work on bare repos

On Mon, 3 Mar 2008 18:29:38 -0600 John Goerzen <jgoerzen@complete.org> wrote:

Show 8 quoted lines
> If I try to point git-relink at a bare repo, I get:
> 
> Usage: /usr/bin/git-relink [--safe] <dir> [<dir> ...] <master_dir>
> All directories should contain a .git/objects/ subdirectory.
> 
> In my case, both master_dir and the CWD are bare repos.
> 
> This is 1.5.4.2
Hi John,

It should probably fixed to work as you would expect. But if your bare repos follow the general naming convention of ending in .git relink will work. That is, if your bare repos are named repo.git rather than just repo.

HTH, Sean

John Goerzen· Mar 4, 2008, 14:34 UTC · re: Sean · lore

Re: git-relink doesn't work on bare repos

On Tue March 4 2008 1:09:59 am Sean wrote:
> It should probably fixed to work as you would expect.   But if your bare
Yep, agreed there.
> repos follow the general naming convention of ending in .git  relink will
> work.  That is, if your bare repos are named  repo.git  rather than just
> repo.
I never do that because I think it's silly to have to type .git everytime ;-)
If I give people a git:// url, they already know it's a Git repo, I figure.
-- John
Johannes Schindelin· Mar 4, 2008, 15:03 UTC · re: John Goerzen · lore

Re: git-relink doesn't work on bare repos

Hi,
On Tue, 4 Mar 2008, John Goerzen wrote:
Show 8 quoted lines
> On Tue March 4 2008 1:09:59 am Sean wrote:
> 
> > repos follow the general naming convention of ending in .git relink 
> > will work.  That is, if your bare repos are named repo.git rather than 
> > just repo.
> 
> I never do that because I think it's silly to have to type .git 
> everytime ;-)

Well, it is a convention, and if you choose not to follow it, that's what you get.

> If I give people a git:// url, they already know it's a Git repo, I 
> figure.

So you must use "--git-dir" _everytime_ you are working with Git inside the repo.

It's not like relink has to be performed several times per hour.

Ciao, Dscho

John Goerzen· Mar 4, 2008, 15:19 UTC · re: Johannes Schindelin · lore

Re: git-relink doesn't work on bare repos

On Tue March 4 2008 9:03:15 am Johannes Schindelin wrote:
Show 13 quoted lines
> Hi,
>
> On Tue, 4 Mar 2008, John Goerzen wrote:
> > On Tue March 4 2008 1:09:59 am Sean wrote:
> > > repos follow the general naming convention of ending in .git relink
> > > will work.  That is, if your bare repos are named repo.git rather than
> > > just repo.
> >
> > I never do that because I think it's silly to have to type .git
> > everytime ;-)
>
> Well, it is a convention, and if you choose not to follow it, that's what
> you get.
That's not documented anywhere.

I mean, git is plubming, right? I should be able to call it myrepo.exe if I like, and as long as it has a .git dir with stuff in it, or is bare, it should just work.

Show 5 quoted lines
> > If I give people a git:// url, they already know it's a Git repo, I
> > figure.
>
> So you must use "--git-dir" _everytime_ you are working with Git inside
> the repo.

That's not been my experience. In fact, I can 'git log' quite happily inside a bare repo. Why on earth should git-relink care what I have named my repo? It's not like git clone, push, pull, or anything else cares.

-- John

← back to recent threads