git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* 'git maintenance' won't work on bare repos
@ 2021-02-23  2:01 Clement Moyroud
  2021-02-23  5:03 ` Eric Sunshine
  0 siblings, 1 reply; 4+ messages in thread
From: Clement Moyroud @ 2021-02-23  2:01 UTC (permalink / raw)
  To: git

Hello,

Because we have a fairly large repository, our developers rely on
worktrees created off a bare mirror clone. I'd like to enable
maintenance, and since the worktrees are rather short-lived instances,
we cannot point 'git maintenance' to it.
So the proper solution is to do it from the bare clone itself.
However, 'git maintenance register' silently fails (with an 0 exit
code). There are two tell-tale signs:
1. 'git config --global --get maintenance.repo' returns '.'
2. There are no Crontab entries inserted.

Running 'git maintenance register' from a worktree created off the
bare clone works as expected.

To reproduce:
git init --bare test-me
git -C test-me maintenance register
git config --global --get maintenance.repo

The workaround, for now, is to run this from a worktree, then use 'git
config' to reset to the corresponding bare clone location.

Thanks,

Clément

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 'git maintenance' won't work on bare repos
  2021-02-23  2:01 'git maintenance' won't work on bare repos Clement Moyroud
@ 2021-02-23  5:03 ` Eric Sunshine
  2021-02-23  7:36   ` Eric Sunshine
  2021-02-23 15:31   ` Clement Moyroud
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Sunshine @ 2021-02-23  5:03 UTC (permalink / raw)
  To: Clement Moyroud; +Cc: Git List

On Mon, Feb 22, 2021 at 9:02 PM Clement Moyroud
<clement.moyroud@gmail.com> wrote:
> So the proper solution is to do it from the bare clone itself.
> However, 'git maintenance register' silently fails (with an 0 exit
> code). There are two tell-tale signs:
> 1. 'git config --global --get maintenance.repo' returns '.'
> 2. There are no Crontab entries inserted.

I can confirm that problem 1 is a bug. However, I am unable to
reproduce problem 2.

Note that the crontab entry won't be created until you run `git
maintenance start`. Is it possible that you are forgetting that step?
(Be aware that `git maintenance start` will show a misleading "no
crontab for <user>" message if you don't already have a crontab file,
but the crontab entry will be created nevertheless, as evidenced by
`crontab -l`.)

> To reproduce:
> git init --bare test-me
> git -C test-me maintenance register
> git config --global --get maintenance.repo

I have a patch which fixes the problem with the bare repo path being
incorrectly registered as ".", but I still need to create a regression
test for it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 'git maintenance' won't work on bare repos
  2021-02-23  5:03 ` Eric Sunshine
@ 2021-02-23  7:36   ` Eric Sunshine
  2021-02-23 15:31   ` Clement Moyroud
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Sunshine @ 2021-02-23  7:36 UTC (permalink / raw)
  To: Clement Moyroud; +Cc: Git List

On Tue, Feb 23, 2021 at 12:03 AM Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Mon, Feb 22, 2021 at 9:02 PM Clement Moyroud
> <clement.moyroud@gmail.com> wrote:
> > So the proper solution is to do it from the bare clone itself.
> > However, 'git maintenance register' silently fails (with an 0 exit
> > code). There are two tell-tale signs:
> > 1. 'git config --global --get maintenance.repo' returns '.'
>
> I have a patch which fixes the problem with the bare repo path being
> incorrectly registered as ".", but I still need to create a regression
> test for it.

Patch posted here:
https://lore.kernel.org/git/20210223073107.40675-1-sunshine@sunshineco.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 'git maintenance' won't work on bare repos
  2021-02-23  5:03 ` Eric Sunshine
  2021-02-23  7:36   ` Eric Sunshine
@ 2021-02-23 15:31   ` Clement Moyroud
  1 sibling, 0 replies; 4+ messages in thread
From: Clement Moyroud @ 2021-02-23 15:31 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: Git List

On Mon, Feb 22, 2021 at 9:03 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
> > 1. 'git config --global --get maintenance.repo' returns '.'
> > 2. There are no Crontab entries inserted.
>
> I can confirm that problem 1 is a bug. However, I am unable to
> reproduce problem 2.
>
> Note that the crontab entry won't be created until you run `git
> maintenance start`. Is it possible that you are forgetting that step?
> (Be aware that `git maintenance start` will show a misleading "no
> crontab for <user>" message if you don't already have a crontab file,
> but the crontab entry will be created nevertheless, as evidenced by
> `crontab -l`.)
>

My bad. I misread the manpage, and didn't try to run 'git maintenance start'
on the bare repo, since the first step did not look right.

> I have a patch which fixes the problem with the bare repo path being
> incorrectly registered as ".", but I still need to create a regression
> test for it.

I saw the patch, thanks for the quick fix!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-23 15:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23  2:01 'git maintenance' won't work on bare repos Clement Moyroud
2021-02-23  5:03 ` Eric Sunshine
2021-02-23  7:36   ` Eric Sunshine
2021-02-23 15:31   ` Clement Moyroud

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git