From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>,
git@vger.kernel.org, jonathantanmy@google.com,
christian.couder@gmail.com, karthik.188@gmail.com
Subject: Re: [PATCH] t0410: modernize delete_object helper
Date: Thu, 12 Mar 2026 15:03:41 -0700 [thread overview]
Message-ID: <xmqqwlzgaeo2.fsf@gitster.g> (raw)
In-Reply-To: <20260312203337.GA2552877@coredump.intra.peff.net> (Jeff King's message of "Thu, 12 Mar 2026 16:33:37 -0400")
Jeff King <peff@peff.net> writes:
> On Thu, Mar 12, 2026 at 06:20:30PM +0530, Siddharth Shrimali wrote:
>
>> delete_object () {
>> - rm $1/.git/objects/$(echo $2 | sed -e 's|^..|&/|')
>> + repo=$1
>> + obj=$2
>> + path="$repo/.git/objects/$(test_oid_to_path $obj)" &&
>> + test_path_is_file "$path" &&
>> + rm "$path"
>> }
>
> It might worth marking these new variables with "local". They are not
> used elsewhere by the script currently, but they are common enough names
> that a collision in the future doesn't seem that unlikely.
Yes, and another thing that was pointed out is it is dubious to use
test_path_is_file here, as "rm" would be loud enough when it fails.
next prev parent reply other threads:[~2026-03-12 22:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 12:50 [PATCH] t0410: modernize delete_object helper Siddharth Shrimali
2026-03-12 14:17 ` Pushkar Singh
2026-03-12 19:05 ` Eric Sunshine
2026-03-12 19:09 ` Junio C Hamano
2026-03-12 20:33 ` Jeff King
2026-03-12 22:03 ` Junio C Hamano [this message]
2026-03-13 2:58 ` [PATCH v2] " Siddharth Shrimali
2026-03-13 4:58 ` Jeff King
2026-03-13 15:29 ` Junio C Hamano
2026-03-18 2:37 ` Jeff King
2026-03-13 5:31 ` [PATCH v3] " Siddharth Shrimali
2026-03-13 15:20 ` Junio C Hamano
2026-03-13 15:19 ` [PATCH v2] " Junio C Hamano
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=xmqqwlzgaeo2.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.com \
--cc=karthik.188@gmail.com \
--cc=peff@peff.net \
--cc=r.siddharth.shrimali@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.