Re: Is Git Add Supposed to Work Like This (git 2.50)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 09, 2025 at 09:00:34AM -0700, Jon Forrest 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.

Interestingly there are a few --ignore-* options, including
--ignore-missing, which I think does what you want. But it only works
with --dry-run. I didn't dig into the rationale.

-Peff




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux