git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] add-patch: quit on EOF
Date: Sat, 25 Oct 2025 17:37:26 -0700	[thread overview]
Message-ID: <xmqqjz0imrax.fsf@gitster.g> (raw)
In-Reply-To: <06b8485e-1e64-4c57-be3a-34b1f900c526@web.de> ("René Scharfe"'s message of "Sat, 25 Oct 2025 19:23:26 +0200")

René Scharfe <l.s.r@web.de> writes:

> On 10/25/25 6:20 PM, Junio C Hamano wrote:
>> 
>> I wonder if we want to 'echo" something in this case, though.  If I
>> say 'q', whether interactive.singlekey is active or not, I see
>> 
>>     (1/1) Stage this hunk [y,n,q,a,d,s,e,p,P,?]? q
>> 
>> on the last line before getting the shell prompt back.  With this
>> change, I won't see anything after the prompt.  Perhaps it is OK?  I
>> dunno.  Perhaps we want to pretend as if 'q' were given instead of
>> EOF, like the following?  I dunno.
> I'm used to no feedback when writing to a file using cat and finishing
> with ctrl-D to signal end-of-file.  So I don't need a q "echoed", and
> would actually be slightly surprised.  But that's just me.

I do not have a strong preference either way myself. It just looked
a bit abrupt the way the session transcript ends, when it gets shut
down with ctrl-D, but after all it is a shutdown, so it may be more
natural that way ;-).

I am kind of surprised that this EOF behaviour has not been brought
up until now, and your patch did not have to touch expected output
of existing tests (certainly they are taking prepackaged series of
commands but I would not imagine all the previous test authors are
careful enough to end their tests with 'q').  Perhaps we do not have
enough multi-hunk and/or multi-file tests on "git add -p" and when
the tests react to EOF they were already at the "final" hunk of the
"final" file and nobody noticed the unnecessary output to skip all
the remaining hunks and files, perhaps.


  reply	other threads:[~2025-10-26  0:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-25  5:46 [PATCH 1/2] add-patch: quit without skipping undecided hunks René Scharfe
2025-10-25  5:48 ` [PATCH 2/2] add-patch: quit on EOF René Scharfe
2025-10-25 16:20   ` Junio C Hamano
2025-10-25 17:23     ` René Scharfe
2025-10-26  0:37       ` Junio C Hamano [this message]
2025-10-26  0:46   ` Junio C Hamano
2025-10-26 16:11     ` René Scharfe
2025-10-25 15:42 ` [PATCH 1/2] add-patch: quit without skipping undecided hunks Junio C Hamano

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=xmqqjz0imrax.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).