Re: [PATCH v2 2/3] rebase -i: re-fix short SHA-1 collision
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 21, 2020, 22:02 UTC
- Message-ID
- <xmqqpnfc8o39.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CAPig+cR2T26nJ1G5n82r_Xi8Y84k211n6bhBxG4Ku27vaW1pWA@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 16 quoted lines
> On Mon, Jan 20, 2020 at 3:04 PM Johannes Schindelin > <Johannes.Schindelin@gmx.de> wrote: >> On Mon, 20 Jan 2020, Eric Sunshine wrote: >> > On Fri, Jan 17, 2020 at 6:38 PM Johannes Schindelin via GitGitGadget >> > <gitgitgadget@gmail.com> wrote: >> > > + test $colliding_sha1 = "$(git rev-parse HEAD | cut -c 1-7)" && >> > >> > How much do we care that this is introducing new code with git >> > upstream of a pipe (considering recent efforts to eradicate such >> > usage)? Same question regarding several other new instances introduce >> > by this patch. >> >> I would argue that the test case will fail if the `git` call fails. So I >> am not overly concerned if that `git` call is upstream of a pipe. > > Unless the git command crashes _after_ it produces the correct output...
True. Doesn't rev-parse have an appropriate option for this kind of thing that gets rid of the need for "cut" in the first place?