Re: [PATCH v3 2/2] diff: index-line: respect --abbrev in object's name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 17, 2020, 16:17 UTC
- Message-ID
- <xmqqo8n9456w.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200815022759.GC12363@danh.dev>
Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
>> Anyone is welcome to have my sign-off if they pick up any part of this >> patch.
Likewise.
Show 10 quoted lines
> This one seems to work with: > > make -j9 test GIT_TEST_DEFAULT_HASH=sha256 > > If noone step up and write this into a patch in some days, > I'll take this as first step in my series. > > Also waiting some days so other people could come up with better idea, > sed's y seems to be able to work if we don't have the constraint > on all-0 oid.
y/// would help with the "same length" transformation, but I think the primary reason why "sed" would not work well in this example is "locate the things to tranform" part is harder to separate from "here is how to transform a token" part when written in "sed".
Yes, you could use /pattern/{ s/from/to/; s/from2/to/; ...} but at least I didn't see an obvious way to simplify the original and reduce its repetitiveness.