From: Junio C Hamano <gitster@pobox.com>
To: Todd Zullinger <tmz@pobox.com>
Cc: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>,
"Renato Botelho" <garga@freebsd.org>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git maintenance broken on FreeBSD
Date: Fri, 12 Aug 2022 22:02:08 -0700 [thread overview]
Message-ID: <xmqqczd4ag8f.fsf@gitster.g> (raw)
In-Reply-To: <YvcdskzUkocUv/d7@pobox.com> (Todd Zullinger's message of "Fri, 12 Aug 2022 23:42:42 -0400")
Todd Zullinger <tmz@pobox.com> writes:
> If a change like this is made, aren't we trading one group
> of broken users for another? It would fix users of newer
> systems at the expense of those on older systems, I would
> suspect.
Thanks for raising this. The description of POSIX "crontab"
command, cf.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html
talks about optional "file", but it is explicit that it has to be a
real file, i.e.
file
The pathname of a file that contains specifications, in the
format defined in the INPUT FILES section, for crontab
entries.
I would suspect that implementations may treat it as a sign to read
the standard input, but I do not think that is what the above
specifies. For example, description of "file" argument of another
command, "diff", cf.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html
explicitly calls out that "-" stands for the standard input, i.e.
diff [-c|-e|-f|-u|-C n|-U n] [-br] file1 file2
file1, file2
A pathname of a file to be compared. If either the file1 or
file2 operand is '-', the standard input shall be used in
its place.
So, it is fairly clear that "crontab" wants a real file. Somebody's
POSIX compliant "crontab" can be fed "-", attempt to read from a
file with such a name, and legitimately fail. And on such a system,
the proposed patch causes a regression.
> In the end, cronie adjusted it's behavior, which was similar
> to that of the newer vixie-cron, in 8b0241f (Partially
> revert the behavior of crontab command without arguments,
> 2021-03-17)¹. It now behaves as required by POSIX if stdin
> is not a TTY. That seems like a reasonable compromise and
> perhaps vixie-cron would be willing to do the same?
It indeed is a pragmatic solution to use isatty() as a hint.
next prev parent reply other threads:[~2022-08-13 5:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 13:51 git maintenance broken on FreeBSD Renato Botelho
2022-08-12 14:44 ` Đoàn Trần Công Danh
2022-08-13 3:42 ` Todd Zullinger
2022-08-13 5:02 ` Junio C Hamano [this message]
2022-08-13 15:37 ` Đoàn Trần Công Danh
2022-08-13 17:26 ` Junio C Hamano
2022-08-13 17:35 ` brian m. carlson
2022-08-15 13:22 ` Derrick Stolee
2022-08-15 16:09 ` Junio C Hamano
2022-08-23 1:01 ` [PATCH] gc: use temporary file for editing crontab brian m. carlson
2022-08-23 9:12 ` Johannes Schindelin
2022-08-23 17:06 ` Derrick Stolee
2022-08-23 21:15 ` brian m. carlson
2022-08-24 16:06 ` Junio C Hamano
2022-08-28 21:41 ` [PATCH v2] " brian m. carlson
2022-08-29 6:46 ` Junio C Hamano
2022-08-29 10:52 ` Renato Botelho
2022-08-30 13:27 ` Derrick Stolee
2022-08-30 20:40 ` [PATCH] test-crontab: minor memory and error handling fixes Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqczd4ag8f.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=congdanhqx@gmail.com \
--cc=garga@freebsd.org \
--cc=git@vger.kernel.org \
--cc=tmz@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.