{"thread":{"id":"55189","subject":"'git maintenance' won't work on bare repos","startedAt":"2021-02-23T02:02:21Z","lastAt":"2021-02-23T15:32:53Z","messageCount":4,"participants":["Clement Moyroud","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"417521","messageId":"CABXAcUzRhkeQhVtwtx-NBR0hbkoo=aCTwN464Dsj8680GPMDxw@mail.gmail.com","threadId":"55189","inReplyTo":null,"subject":"'git maintenance' won't work on bare repos","fromName":"Clement Moyroud","fromEmail":"clement.moyroud@gmail.com","sentAt":"2021-02-23T02:01:24Z","receivedAt":"2021-02-23T02:02:21Z","isPatch":false,"sender":{"key":"clement.moyroud@gmail.com","avatar":null},"body":"Hello,\n\nBecause we have a fairly large repository, our developers rely on\nworktrees created off a bare mirror clone. I'd like to enable\nmaintenance, and since the worktrees are rather short-lived instances,\nwe cannot point 'git maintenance' to it.\nSo the proper solution is to do it from the bare clone itself.\nHowever, 'git maintenance register' silently fails (with an 0 exit\ncode). There are two tell-tale signs:\n1. 'git config --global --get maintenance.repo' returns '.'\n2. There are no Crontab entries inserted.\n\nRunning 'git maintenance register' from a worktree created off the\nbare clone works as expected.\n\nTo reproduce:\ngit init --bare test-me\ngit -C test-me maintenance register\ngit config --global --get maintenance.repo\n\nThe workaround, for now, is to run this from a worktree, then use 'git\nconfig' to reset to the corresponding bare clone location.\n\nThanks,\n\nClément\n"},{"id":"417532","messageId":"CAPig+cSvYLMtML5ya4GR30-nfNNt19okLjchkkdhdzAEB19H4g@mail.gmail.com","threadId":"55189","inReplyTo":"CABXAcUzRhkeQhVtwtx-NBR0hbkoo=aCTwN464Dsj8680GPMDxw@mail.gmail.com","subject":"Re: 'git maintenance' won't work on bare repos","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-02-23T05:03:00Z","receivedAt":"2021-02-23T05:04:11Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Feb 22, 2021 at 9:02 PM Clement Moyroud\n<clement.moyroud@gmail.com> wrote:\n> So the proper solution is to do it from the bare clone itself.\n> However, 'git maintenance register' silently fails (with an 0 exit\n> code). There are two tell-tale signs:\n> 1. 'git config --global --get maintenance.repo' returns '.'\n> 2. There are no Crontab entries inserted.\n\nI can confirm that problem 1 is a bug. However, I am unable to\nreproduce problem 2.\n\nNote that the crontab entry won't be created until you run `git\nmaintenance start`. Is it possible that you are forgetting that step?\n(Be aware that `git maintenance start` will show a misleading \"no\ncrontab for <user>\" message if you don't already have a crontab file,\nbut the crontab entry will be created nevertheless, as evidenced by\n`crontab -l`.)\n\n> To reproduce:\n> git init --bare test-me\n> git -C test-me maintenance register\n> git config --global --get maintenance.repo\n\nI have a patch which fixes the problem with the bare repo path being\nincorrectly registered as \".\", but I still need to create a regression\ntest for it.\n"},{"id":"417545","messageId":"CAPig+cTGe1=uqLw1Hxe+5=0WyWEJCOaqHEqLkuYmgR1pG+xVOA@mail.gmail.com","threadId":"55189","inReplyTo":"CAPig+cSvYLMtML5ya4GR30-nfNNt19okLjchkkdhdzAEB19H4g@mail.gmail.com","subject":"Re: 'git maintenance' won't work on bare repos","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2021-02-23T07:36:34Z","receivedAt":"2021-02-23T07:37:30Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Feb 23, 2021 at 12:03 AM Eric Sunshine <sunshine@sunshineco.com> wrote:\n> On Mon, Feb 22, 2021 at 9:02 PM Clement Moyroud\n> <clement.moyroud@gmail.com> wrote:\n> > So the proper solution is to do it from the bare clone itself.\n> > However, 'git maintenance register' silently fails (with an 0 exit\n> > code). There are two tell-tale signs:\n> > 1. 'git config --global --get maintenance.repo' returns '.'\n>\n> I have a patch which fixes the problem with the bare repo path being\n> incorrectly registered as \".\", but I still need to create a regression\n> test for it.\n\nPatch posted here:\nhttps://lore.kernel.org/git/20210223073107.40675-1-sunshine@sunshineco.com/\n"},{"id":"417564","messageId":"CABXAcUwdpJa1osz=9xarVgbP9wFK82rbx8J1vk-EZEA5x25ffQ@mail.gmail.com","threadId":"55189","inReplyTo":"CAPig+cSvYLMtML5ya4GR30-nfNNt19okLjchkkdhdzAEB19H4g@mail.gmail.com","subject":"Re: 'git maintenance' won't work on bare repos","fromName":"Clement Moyroud","fromEmail":"clement.moyroud@gmail.com","sentAt":"2021-02-23T15:31:58Z","receivedAt":"2021-02-23T15:32:53Z","isPatch":false,"sender":{"key":"clement.moyroud@gmail.com","avatar":null},"body":"On Mon, Feb 22, 2021 at 9:03 PM Eric Sunshine <sunshine@sunshineco.com> wrote:\n> > 1. 'git config --global --get maintenance.repo' returns '.'\n> > 2. There are no Crontab entries inserted.\n>\n> I can confirm that problem 1 is a bug. However, I am unable to\n> reproduce problem 2.\n>\n> Note that the crontab entry won't be created until you run `git\n> maintenance start`. Is it possible that you are forgetting that step?\n> (Be aware that `git maintenance start` will show a misleading \"no\n> crontab for <user>\" message if you don't already have a crontab file,\n> but the crontab entry will be created nevertheless, as evidenced by\n> `crontab -l`.)\n>\n\nMy bad. I misread the manpage, and didn't try to run 'git maintenance start'\non the bare repo, since the first step did not look right.\n\n> I have a patch which fixes the problem with the bare repo path being\n> incorrectly registered as \".\", but I still need to create a regression\n> test for it.\n\nI saw the patch, thanks for the quick fix!\n"}]}