All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Derrick Stolee <stolee@gmail.com>,
	Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, szeder.dev@gmail.com, ukshah2@illinois.edu,
	Kevin.Willford@microsoft.com,
	Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH v2 8/8] test-lib: clear watchman watches at test completion
Date: Tue, 10 Dec 2019 15:09:02 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1912101457200.31080@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <xmqqo8wgsqnn.fsf@gitster-ct.c.googlers.com>

Hi,

On Mon, 9 Dec 2019, Junio C Hamano wrote:

> Derrick Stolee <stolee@gmail.com> writes:
>
> > Hm. That is a good point. Can we assume that our version of grep has
> > a "-F" or "--fixed-strings" option? ([1] seems to say that "-F" would
> > work.)
>
> $ git grep "grep -F" -- \*.sh
>
> is your friend ;-)
>
> And never use https://www.gnu.org/ manual as a yardstick---you will
> end up using GNUism that is not unavailable elsewhere pretty easily.
>
> > [1] https://www.gnu.org/savannah-checkouts/gnu/grep/manual/grep.html#index-grep-programs

I often look at GNU grep's man page first and then verify via
https://man.openbsd.org/grep and
https://pubs.opengroup.org/onlinepubs/009695399/utilities/grep.html
that the option can be considered portable.

> >> What are these stripping of ", and " about?  Could you tell readers
> >> how a typical output from the program we are reading from looks like
> >> perhaps in the log message or in-code comment around here?
> >
> > Watchman outputs its list of paths in JSON format. Luckily, it formats
> > the output so the path lines are on separate lines, each quoted.
> >
> > For example:
> >
> > {
> > 	"version": "4.9.0",
> > 	"roots": [
> > 		"<path1>",
> > 		"<path2>",
> > 		"<path3>"
> > 	]
> > }
>
> Yeek; how is a dq in path represented?  by doubling?  by
> backslash-quoting (if so how is a backslash in path represented)?
> By something else?
>
> It's OK at least for now to declare that our test repository does
> not contain any funny paths, but in the longer run does the above
> mean that we somehow need to be able to grok JSON reliably in our
> tests?  It may not be such a bad thing especially for longer term,
> as there are other parts of the system that may benefit from having
> JSON capable output readers in our tests (e.g. trace2 code can do
> JSON, right?)..

From
https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
(section "9 String"):

A string is a sequence of Unicode code points wrapped with quotation marks
(U+0022). All code points may be  placed  within  the  quotation  marks
except  for  the code  points that  must  be  escaped:  quotation  mark
(U+0022), reverse solidus (U+005C), and the control characters U+0000 to
U+001F. There are two-character escape sequence representations of some
characters.

	\"	represents the quotation mark character (U+0022).
	\\	represents the reverse solidus character(U+005C).
	\/	represents the solidus character (U+002F).
	\b	represents the backspace character(U+0008).
	\f	represents the form feed character (U+000C).
	\n	represents the line feed character (U+000A).
	\r	represents the carriage return character (U+000D).
	\t	represents the character tabulation character (U+0009).

(Side note: It is amazing what things you learn unexpectedly, e.g. when
researching information about the JSON format, you learn that about the
word "solidus", that it refers to the slash, and that it was once also
know as the "shilling mark"...)

I am not sure why the forward slash needs to be escaped, but I guess that
this is voluntary rather than mandatory.

Ciao,
Dscho

      parent reply	other threads:[~2019-12-10 14:09 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 22:20 [PATCH 00/11] Improve testability with GIT_TEST_FSMONITOR Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 01/11] fsmonitor: disable in a bare repo Derrick Stolee via GitGitGadget
2019-11-21 23:18   ` Denton Liu
2019-11-22  1:57     ` Derrick Stolee
2019-11-21 22:20 ` [PATCH 02/11] fsmonitor: do not output to stderr for tests Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 03/11] t1301-shared-repo.sh: disable FSMONITOR Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 04/11] t1510-repo-setup.sh: disable fsmonitor if no .git dir Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 05/11] fsmonitor: disable fsmonitor with worktrees Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 06/11] t3030-merge-recursive.sh: disable fsmonitor when tweaking GIT_WORK_TREE Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 07/11] t3600-rm.sh: disable fsmonitor when deleting populated submodule Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 08/11] tests: disable fsmonitor in submodule tests Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 09/11] t7063: disable fsmonitor with status cache Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 10/11] t7519: disable external GIT_TEST_FSMONITOR variable Derrick Stolee via GitGitGadget
2019-11-21 22:20 ` [PATCH 11/11] test-lib: clear watchman watches at test completion Derrick Stolee via GitGitGadget
2019-11-22  1:06   ` SZEDER Gábor
2019-12-09 14:12     ` Derrick Stolee
2019-12-09 23:40       ` SZEDER Gábor
2019-12-10  1:43         ` Derrick Stolee
2019-12-09 16:09 ` [PATCH v2 0/8] Improve testability with GIT_TEST_FSMONITOR Derrick Stolee via GitGitGadget
2019-12-09 16:09   ` [PATCH v2 1/8] fsmonitor: disable in a bare repo Derrick Stolee via GitGitGadget
2019-12-10  9:46     ` SZEDER Gábor
2019-12-09 16:09   ` [PATCH v2 2/8] fsmonitor: do not output to stderr for tests Derrick Stolee via GitGitGadget
2019-12-09 16:09   ` [PATCH v2 3/8] t1301-shared-repo.sh: disable FSMONITOR Derrick Stolee via GitGitGadget
2019-12-10  9:43     ` SZEDER Gábor
2019-12-09 16:10   ` [PATCH v2 4/8] t3030-merge-recursive.sh: disable fsmonitor when tweaking GIT_WORK_TREE Derrick Stolee via GitGitGadget
2019-12-10 10:07     ` SZEDER Gábor
2019-12-10 13:45       ` Derrick Stolee
2019-12-10 14:57         ` SZEDER Gábor
2019-12-10 15:07         ` SZEDER Gábor
2020-01-23 15:45           ` Derrick Stolee
2019-12-09 16:10   ` [PATCH v2 5/8] tests: disable fsmonitor in submodule tests Derrick Stolee via GitGitGadget
2019-12-10 10:13     ` SZEDER Gábor
2019-12-10 13:57       ` Derrick Stolee
2019-12-09 16:10   ` [PATCH v2 6/8] t7063: disable fsmonitor with status cache Derrick Stolee via GitGitGadget
2019-12-09 16:10   ` [PATCH v2 7/8] t7519: disable external GIT_TEST_FSMONITOR variable Derrick Stolee via GitGitGadget
2019-12-09 16:10   ` [PATCH v2 8/8] test-lib: clear watchman watches at test completion Derrick Stolee via GitGitGadget
2019-12-09 22:52     ` Junio C Hamano
2019-12-10  1:49       ` Derrick Stolee
2019-12-10  5:20         ` Junio C Hamano
2019-12-10 13:51           ` Derrick Stolee
2019-12-10 14:09           ` Johannes Schindelin [this message]

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=nycvar.QRO.7.76.6.1912101457200.31080@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=Kevin.Willford@microsoft.com \
    --cc=dstolee@microsoft.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=stolee@gmail.com \
    --cc=szeder.dev@gmail.com \
    --cc=ukshah2@illinois.edu \
    /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.