All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Koichi Murase <myoga.murase@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org,
	"Justin Donnelly" <justinrdonnelly@gmail.com>,
	"Denton Liu" <liu.denton@gmail.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	"Edwin Kofler" <edwin@kofler.dev>,
	"Koichi Murase" <myoga.murase@gmail.com>
Subject: Re: [PATCH] completion: suppress unwanted unescaping of `read`
Date: Mon, 24 Apr 2023 07:52:12 -0600	[thread overview]
Message-ID: <6446898cd2dc3_aba294be@chronos.notmuch> (raw)
In-Reply-To: <20230420223800.1698197-1-myoga.murase@gmail.com>

Koichi Murase wrote:
> From: Edwin Kofler <edwin@kofler.dev>
> 
> The function `__git_eread`, which reads the first line from the file,
> calls the `read` builtin without passing the flag option `-r`.  When
> the `read` builtin is called without the flag `-r`, it processes the
> backslash escaping in the text that it reads.  For this reason, it is
> generally considered the best practice to always use the `read`
> builtin with flag `-r` unless one intensionally processes the
> backslash escaping.  For the present case in git-prompt.sh, in fact,
> all the occurrences of the calls of `__git_eread` intend to read the
> literal content of the first lines.

This is my undrstanding.

I agree using `-r` is a good practice.

> To make it read the first line literally, pass the flag `-r` to the
> `read` builtin in the function `__git_eread`.
> 
> Signed-off-by: Edwin Kofler <edwin@kofler.dev>
> Signed-off-by: Koichi Murase <myoga.murase@gmail.com>

Acked-by: Felipe Contreras <felipe.contreras@gmail.com>

-- 
Felipe Contreras

  parent reply	other threads:[~2023-04-24 13:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20  7:46 [PATCH 1/2] completion: quote arguments of test and [ Koichi Murase
2023-04-20  7:46 ` [PATCH 2/2] completion: suppress unwanted unescaping of `read` Koichi Murase
2023-04-20 16:45   ` Junio C Hamano
2023-04-20 22:31     ` Koichi Murase
2023-04-20 22:38       ` [PATCH] " Koichi Murase
2023-04-20 22:47         ` Junio C Hamano
2023-04-24 13:52         ` Felipe Contreras [this message]
2023-04-20 16:31 ` [PATCH 1/2] completion: quote arguments of test and [ Junio C Hamano
2023-04-20 20:59   ` Koichi Murase
2023-04-24 13:43   ` Felipe Contreras

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=6446898cd2dc3_aba294be@chronos.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=edwin@kofler.dev \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=justinrdonnelly@gmail.com \
    --cc=liu.denton@gmail.com \
    --cc=myoga.murase@gmail.com \
    --cc=szeder.dev@gmail.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.