git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git maintenance broken on FreeBSD

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
Aug 12, 2022, 14:44 UTC
Message-ID
<YvZnQFVMZZmz9TIX@danh.dev>
In-Reply-To
<226317ba-a78f-216c-764c-52f4e393bd35@FreeBSD.org>
On 2022-08-12 10:51:03-0300, Renato Botelho <garga@FreeBSD.org> wrote:
Show 5 quoted lines
> As reported at [1], git maintenance is not working on FreeBSD.  I didn't
> find the time to dig into it but it seems like it's calling crontab using
> parameters not supported on FreeBSD.
> 
> [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260746

It seems like FreeBSD's cron is vixie-cron which requires <file> passed to crontab(1).

     The crontab command conforms to IEEE Std 1003.2 (“POSIX.2”) with the
     exception that the dangerous variant of calling crontab without a file
     name in the first form of the command is not allowed by this
     implementation.  The pseudo-filename ‘-’ must be specified to read from
     standard input.  The new command syntax differs from previous versions of
     Vixie Cron, as well as from the classic SVR3 syntax.

I think other crontab implementation also accept "-" as filename for stdin. At least cronie, fcron, dcron, and busybox's crontab both supports "-" as stdin.

I think this patch can fix FreeBSD's problem:
---- 8< -----
diff --git a/builtin/gc.c b/builtin/gc.c
index eeff2b760e..45d908def3 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -2087,6 +2087,7 @@ static int crontab_update_schedule(int run_maintenance, int fd)
 	rewind(cron_list);
 
 	strvec_split(&crontab_edit.args, cmd);
+	strvec_push(&crontab_edit.args, "-");
 	crontab_edit.in = -1;
 	crontab_edit.git_cmd = 0;
 
---- 8< ---------
-- 
Danh
Previous: Renato BotelhoNext: Todd Zullinger
Message 2 of 19 in “git maintenance broken on FreeBSD”
  1. Renato BotelhoAug 12, 2022
  2. Đoàn Trần Công DanhAug 12, 2022
  3. Todd ZullingerAug 13, 2022
  4. Junio C HamanoAug 13, 2022
  5. Đoàn Trần Công DanhAug 13, 2022
  6. Junio C HamanoAug 13, 2022
  7. brian m. carlsonAug 13, 2022
  8. Derrick StoleeAug 15, 2022
  9. Junio C HamanoAug 15, 2022
  10. gc: use temporary file for editing crontabbrian m. carlson, Aug 23, 2022
  11. Johannes SchindelinAug 23, 2022
  12. Derrick StoleeAug 23, 2022
  13. brian m. carlsonAug 23, 2022
  14. Junio C HamanoAug 24, 2022
  15. gc: use temporary file for editing crontabbrian m. carlson, Aug 28, 2022
  16. Junio C HamanoAug 29, 2022
  17. Renato BotelhoAug 29, 2022
  18. Derrick StoleeAug 30, 2022
  19. test-crontab: minor memory and error handling fixesJeff King, Aug 30, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.