From: "Σταύρος Ντέντος" <stdedos@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>,
git <git@vger.kernel.org>
Subject: Re: git format-patch can clobber existing patch
Date: Sat, 23 Feb 2019 11:53:50 +0200 [thread overview]
Message-ID: <CAHMHMxXxo4zXcriBJE2k3mWgwAj7KGA_AChuEmyciESGOC_7Bg@mail.gmail.com> (raw)
In-Reply-To: <xmqqva1bpq9d.fsf@gitster-ct.c.googlers.com>
Ντέντος Σταύρος
On Fri, Feb 22, 2019 at 9:38 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
>
> > On Thu, Feb 21, 2019 at 03:40:09PM -0800, Junio C Hamano wrote:
> >> Σταύρος Ντέντος <stdedos@gmail.com> writes:
> >> > Would it make sense / be easy enough to have some clobbering check / flag?
> >>
> >> Given that use of '-o' to redirect to a fresh/new directory would
> >> reduce the risk of such clobbering, and use of '-v' to force
> >> different filenames would reduce the risk of such clobbering,
> >> it seems to me that aborting the operation when we fail to open
> >> the output, without any option to override and allow clobbering,
> >> would make sense. If existing files record 4 patch series
> >> 0001-x.patch, 0002-y.patch, 0003-z.patch, and 0004-w.patch, and you
> >> generate with "format-patch --allow-clobbering" a three-patch series,
> >> it would overwrite 0001 thru 0003 but will not remove 0004, so the
> >> end result will still be confusing.
There might be a handful of complexities / undefined behaviors coming
out of this; however, I think "not" overwriting a file to be a higher
directive (given that then, it is unrecoverable).
Using any of the '-o', '-v' might be helpful - if you are re-running
commands from history, however, it wouldn't necessarily provide any
protection ;-)
> > I think a flag for this would be useful. For people that store tarballs
> > (or pristine-tar files) and patches in their repository, overwriting the
> > existing files is definitely desired.
> >
> > My personal preference is that the flag be --no-clobber, but I can see
> > arguments for the other side as well.
On my head, I was thinging that preferably `git config
format-patch.no-clobber true` could be set, instead of (continuously)
carrying around a `--no-clobber` flag.
I should've probably be more clear about that. However, any way is "as
good as any".
> That's actually simpler, which is good, as we do not have to worry
> about adjusting the existing tests that rely on the clobbering
> behaviour ;-).
>
> I'll find time before I leave for my offline week, but this
> obviously will not be merged before the upcoming release.
>
> Thanks. I think I've mostly outlined a three-patch series to do
> this ready.
>
>
>
>
>
>
>
prev parent reply other threads:[~2019-02-23 9:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAHMHMxVdpOnTkf9RHzCa+YjjvpqJApsSE03Jjyb_VbJp_4q-jw@mail.gmail.com>
2019-02-21 14:25 ` git format-patch can clobber existing patch Σταύρος Ντέντος
2019-02-21 23:40 ` Junio C Hamano
2019-02-22 0:11 ` brian m. carlson
2019-02-22 19:38 ` Junio C Hamano
2019-02-23 9:53 ` Σταύρος Ντέντος [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=CAHMHMxXxo4zXcriBJE2k3mWgwAj7KGA_AChuEmyciESGOC_7Bg@mail.gmail.com \
--to=stdedos@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.net \
/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).