public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jon Forrest <nobozo@gmail•com>
To: Jeff King <peff@peff•net>
Cc: git@vger•kernel.org
Subject: Re: Is Git Add Supposed to Work Like This (git 2.50)?
Date: Tue, 9 Sep 2025 09:00:34 -0700	[thread overview]
Message-ID: <b8df3605-7afe-4121-ae50-095dfd671df9@gmail.com> (raw)
In-Reply-To: <20250907233456.GA1281511@coredump.intra.peff.net>



On 9/7/25 4:34 PM, Jeff King wrote:

> I guess one could argue either way (though probably not at this point in
> time, as switching behaviors would cause confusion). But one challenge
> with "partial success" like this is that the exit code is binary. If we
> return "0" even though some items were ignored, callers may miss a
> failure. If we return "1" even though some items were added, callers may
> not realize they've mutated the state (and might need to rollback
> depending on what they were trying to accomplish).

If this were a big deal, which it isn't, I'd suggest a command line
flag that says what to do if there's an invalid file specified on
the command line. One setting of the flag would result in the
current behavior and the other setting would result in all the
invalid file(s) being ignored and the valid file(s) being
handled normally.

Jon


  reply	other threads:[~2025-09-09 16:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-07  2:02 Is Git Add Supposed to Work Like This (git 2.50)? Jon Forrest
2025-09-07  8:10 ` Re " K Jayatheerth
2025-09-07 23:34 ` Jeff King
2025-09-09 16:00   ` Jon Forrest [this message]
2025-09-09 18:33     ` Jon Forrest
2025-09-09 18:42       ` Jeff King
2025-09-09 20:55         ` Junio C Hamano
2025-09-09 21:01           ` Jeff King
2025-09-09 18:40     ` 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=b8df3605-7afe-4121-ae50-095dfd671df9@gmail.com \
    --to=nobozo@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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