Article View: linux.kernel.git
Article #2032Re: [PATCH] [Outreachy PATCH] t4041: use submodule repository for commit abbreviations
From: Srujith Poojary
Date: Sat, 31 Oct 2026 19:08
Date: Sat, 31 Oct 2026 19:08
61 lines
14035 bytes
14035 bytes
On Sat, Oct 31, 2026 at 10:16 PM Okhuomon Ajayi <okhuomonajayi54@gmail.com> wrote: > > Hi Srujith, > > I applied this on top of master and ran t4041. The new test fails > without the submodule.c change and passes with it, so it does catch > the problem. > > A few small things: > > On Sat, Oct 31, 2026 at 9:26 AM Srujith A Poojary via GitGitGadget > <gitgitgadget@gmail.com> wrote: > > Use the submodule repository when abbreviating commit IDs in > > submodule diff headers, so uniqueness is checked against the > > correct object database. > > It would help to first describe what happens today: the commit IDs > in the "Submodule ..." header are abbreviated against the > superproject's objects, even though the commits live in the > submodule, so the abbreviation may not be unique there. > > > [Outreachy PATCH] t4041: use submodule repository for commit > > abbreviations > > The change itself is in submodule.c, so the title might read better > with that area, e.g. "submodule: use the submodule repository to > abbreviate commits". > > > - strbuf_add_unique_abbrev(&sb, one, DEFAULT_ABBREV); > > + if (sub) > > + strbuf_repo_add_unique_abbrev(&sb, sub, one, DEFAULT_ABBREV); > > + else > > + strbuf_add_unique_abbrev(&sb, one, DEFAULT_ABBREV); > > The same if/else appears twice. Maybe choose the repository once, > at the top of the function, and call strbuf_repo_add_unique_abbrev() > with it in both places. I also wonder whether the fallback could be > o->repo instead of the_repository, since the diff options already > carry a repository. > > Thanks, > Okhuomon Hi Okhuomon, Thanks for reviewing the patch and testing the new test case. I've made the suggested changes and submitted v2. I now use `sub` when available and fall back to `o->repo` when it isn't. I also simplified the code and updated the commit message. Here is the updated patch: https://lore.kernel.org/git/pull.2288.v2.git.1793473062113.gitgitgadget@gmail.com Thanks again! Regards, Srujith
Technical Details
Message-ID:
<CABh_KWh0N0y7rN61wx5=zQWs3QmD8Ho6ONig75ocj8zFWKh4bw@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74031-linux-kernel-git=dewy.ruReferences:
<pull.2288.git.1793435149942.gitgitgadget@gmail.com> <CAFpMFfALb1KbEw-dc4wYCxS4PXfDBwzQOD6YPRe52_bpRnGt9w@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-74031-linux-kernel-git=dewy.ru
From: poojarysrujith@gmail.com (Srujith Poojary)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] [Outreachy PATCH] t4041: use submodule repository for
commit abbreviations
Date: Sun, 1 Nov 2026 00:38:18 +0530
Organization: Usenet Network
Message-ID: <CABh_KWh0N0y7rN61wx5=zQWs3QmD8Ho6ONig75ocj8zFWKh4bw@mail.gmail.com>
References: <pull.2288.git.1793435149942.gitgitgadget@gmail.com> <CAFpMFfALb1KbEw-dc4wYCxS4PXfDBwzQOD6YPRe52_bpRnGt9w@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="2531702"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7AF2a3/BrEuFgBA3ADET/p1pTL0= sha256:VOTQDZj/sJv5CQVCCVu74INrI+b1M+ab/0vPbEHMu74=
sha1:8wXmgwzIEGyOj8W6uMCiMk9Uk3o= sha256:atcKeTJu0eKrhCeMpdxoeFRS8smXOpRvdfw+DT66Oc8=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 261AB125CBC; Sat, 31 Oct 2026 22:09:00 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id EIYPNs_80Eup;
Sat, 31 Oct 2026 22:08:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-74031-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id C97A0125CB5; Sat, 31 Oct 2026 22:08:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 75E9726B45; Sat, 31 Oct 2026 19:08:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793473712;
b=veEgX6iW5C1o15BWlsQUfmj697bDLy2BgPj9DgRmxPed+EgcBHCYiVMhfUYU/1J2NEPv
2jo3nrh4C+yurLjfYHTUzDSIj6pDfHOORW748tVXUh9lex/1g0LUAzA8wFWLVZHg2W0SH
pqtmY5BfkyCxhbxjs2Pqfsh6WNTGxKbSbTKD3MCxhri4GDgxZVUU5hfqfNaWGrfyGstmx
beH6bVvyz+70/RQNwBkxn3tat+OKNsx1AjwYGsSECQqdLk83uFbpPqCxo3kRcu/v7GCUs
xl8E18m3dLLO0X5j9seUJbLq86cv1SOxczjx5gx1IoOtaHfNqJeufDx5YO0f491uUfA==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793473712;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
References:In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:
Cc:Content-Type:Content-Transfer-Encoding;
bh=sDmlTxezdPFtYSKNsPxm7Vl1oLEBZBWr2TyrrMgrEEk=;
b=qE25miTH4q5MscSB741GXD1fU+GCbCKWd3jKAa5u7/ktUTB/+VPk2TKxRg6QGi0jMMvj
lXgYtATE0r4OFx884yVHC8BXGVJO0FmOVlZA2ArmbBjgcrjN/GAJSFDVE5KjLx/Wane0O
Cq+l5C/BWhL9+49e/BH2DqqHZ6DUZn0gjPk7QyttLRX3mfvF0aIfICKUxwsFWD+o4Q1hv
soBkfyU////+JWNKyRQA0rUS0Nj0eM0x022xiwdWYDmy+W+coxl+wyML/5CUG53CGrK2Q
q6gjmcAsYce9eA15BDMFtiRVdxQamSGDAbaT23KFVhJ2yzAqsxY/9+Vxm6YUKVNVLjA==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=dq0Ix8jm;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 49DBD606A321;
Sat, 31 Oct 2026 19:08:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=dq0Ix8jm
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.219.48
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1793473711;
b=Wr+CcESVeC2qgr/+5p+m4Wc8U9zPDPmZ5dRW5GsULGV5npX+XQiihypsJO6trc3nZOcT
8edv2HYGJtg3PQjn55KruV2lUyzFtC0dwgTxr6ngaHQ/tlPwBZUjxGZwpgO/c/O3YFMOq
0KczU7RwFHNCv5m124iDSa1I+SG3MF1NsTVak/qiMzf7BlECMNJUNS71p82ra3ctwDdKO
ZFs+/rMWoGeN4psNl+6H9Inl8aU+I9vI0Hn415PfV1EaCVhzzHkcpXSAASyxSY+zPbkLR
WpKNFdNBsi9mLg31MR8uvtfR5dXZFfgcYO1K49FJItPIpoHUIYiUqeZi8MJlDqITmLg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793473711;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:
MIME-Version:References:In-Reply-To:From:Date:X-Gm-Features:
Message-ID:Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
bh=sDmlTxezdPFtYSKNsPxm7Vl1oLEBZBWr2TyrrMgrEEk=;
b=hFjLhub7rCCRbR6YLPlh6AoyqCK9IazR1BKsyEF1lPGEkeuIqnNRw2LQBPOhRE7167Wc
hzSrXDcZpDbYWWOFE/vNntLbWq3XeVtBO2bfMI2FJ/FjAkF9UncFKiu9yGb3VQtvPxmT0
sugsFqSHwLVfAAvYEXUJydRSC2nJ2EKwXhzk66xVblXYVLySNn+FAwwlAw89dnM9MLLxX
6C1lHpJpmfn8Ysb97bK1DUhl5hrar0DZ12GAM3BSgfa18LgrmNccOJbGAqXnwsHXbviKS
YrcXqzbljfBjbQ6hEQup0mtRL+znwYs11GbKx5SouSzyYZJih38AFAMh9RqWoN/yLEA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=dq0Ix8jm;
arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.219.48
X-Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07F14606A31A
for <git@vger.kernel.org>; Sat, 31 Oct 2026 19:08:30 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 07F14606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-91bb5795792so21263436d6.2
for <git@vger.kernel.org>; Sat, 31 Oct 2026 12:08:30 -0700 (PDT)
X-ARC-Seal: i=1; a=rsa-sha256; t=1793473710; cv=none;
d=google.com; s=arc-20260327;
b=YpgxQDFYn9EEwgr/OczR7SdfCYcmqNhTIubGMRpPMdd89/lOWZrjHvwl9LqMPdlo4v
hryL32lmOjSXvUbgVFDyTQGAVDeG/Fu/0j9GjNicZ2nv1TVlGRcP8v7nau7O+Bslb0qJ
ebRYz8I2WYp4caN3ioMNhMo4vunIu2/LgdyIiWO+wLgsDoAwpNL29p4Eh5WHF/24NCx8
8BWecMVIFaaLpD4ZNfg5OwIBCo9dnIU//qsg3+Zh2V+NsS4acev6GGRKRQb9G5Ziy2/5
I1sEoVNFiW4nszPBVgllgle2LpbLqJ42b0UFATGibOLAKKeAvYWaBW1aqL1/EVG/BRhN
XtJQ==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:dkim-signature;
bh=sDmlTxezdPFtYSKNsPxm7Vl1oLEBZBWr2TyrrMgrEEk=;
fh=0ntEjTNBVORqxkOvMCyrsNWjOyMy54RXFfOMQ0AFUFo=;
b=QkXgZTXQfzQobeXTryXXZhb/OF//NHnm7pvtu0iUKwuQDODsYTCqstRodxArEdF930
ah65L/+W+iBkQud4ZujzyWpR1UVvJqSw8K/MR+B2mnYeMI28PG/NVJGkwer7SYohRSex
PQgW2ooR9D9rTQSYNiWitP5LqZ9AYkqiYPYOysTClyEeJiQ8jlElImeSYw4UHFa8r1PU
ro/6bnGpJ4B4EgO0ICQfrZ3TI2ao/CkDlWi0ovyA/sf9wkAqKqQUZNAOPHgE7avgL3Kx
zp0dr5TowJXwG9kchwGZ4eD3vGaksC5dkjSI19K+dr14ve4nPpapSOFpeRlh4v/HLXZy
P2xg==;
darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1793473710; x=1794078510; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=sDmlTxezdPFtYSKNsPxm7Vl1oLEBZBWr2TyrrMgrEEk=;
b=dq0Ix8jmqxu5SJT5OSNrPiurqTl93AcTTg9e3O2lhEqU0nIwE+IpM/TcSlEtXtluTD
fxplOA6RgVfcWuiI7AR5nJ3BkoLD/XWO/LF634nhnqJpJKE4KX0E0pmfj5sS1ZXnDNXI
wOE+qu0wFFe6+BKkMbbdhCYfMArEjHtZE/QehXAaEva8f7QtEblLZbWFjUPJD9TJhCN9
ra9iQYAHbCbJUUGr1JVp4zpIHh2OLwwjxajwgkdqKmBvBw+C9x2C0J0N/6B1b7PchfJG
kHtGwAq9ESsqjv/9wD3la2fCP9oxkaHOK+ZMgTTEE4BUPDjS29FVXfOM8JmNB6QEdIxg
uY0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1793473710; x=1794078510;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=sDmlTxezdPFtYSKNsPxm7Vl1oLEBZBWr2TyrrMgrEEk=;
b=VC56U6oZ16/0VO6Ptlr0//88zPgWIkKGwEBSf97vu/okAinOuJeGFN7mr0vphGm1YP
BWx87dPYQNbKDPayY1rNd1A2O0S/W4VoK9hk4BKidhmGEx/Du0XDSnl1a6aKY/FxrELD
MkNv6tjQ+uE3rN+8DPq/3XLL/Nd526QtfR5Kr9w0WdtzvS4H5iNFIXOF0wkDZE3jVQGl
rFSOitZlvxIuFMarfIjCNAtsU822QFswt2JGfh1a3be6gz4fFqz4TVEahfckrVPovnkw
CTFz4aeWy+sqomeMWmvkx6FTQabnVydoJ50dJYOZly9IwBKfNIYi4DgaEkP/KvGrl2MX
zpSg==
X-Forwarded-Encrypted: i=1; AKwUvBxJGTHAArY0uvpjbGehQIXBK15h6X14VS3rjB5ERbaeITAyLvG/O19DkeI/hb1d9WzusTo=@vger.kernel.org
X-Gm-Message-State: AFq9FYIbbvtJQAbDhbTj6bNbeFicPsjVpJ0GPP2TO6qjamB083rImSZf
ZMqX15Xt7VMYXV94Z+YXz1HeYjpQObnmc54SzCOexVu8NHf4nQe7wRE18jiHYkitzV7Wz18OUfv
dluOlIAKNjeikSeaA5XaWrvTf1YhevZw=
X-Gm-Gg: AYBFou1fuuZHzPKJze2VaUOeoHiKMlKRlhlCxE2XVjuIvoeHA1fDFA00negmdlpfBZb
VSJEQlEhVxDNmQY9wOwcXsHEHtgGE1ENqZtV9zU3qZyrfIqMHekxQsI+HkUQfQ8MPyff2bCXwjq
f3pp9CU7l79lDQ3TMGlBcaGBHmjlDgrdeAXJ4eWuHWTEhtdBeFSfS0AqL5NJ0mn4NkRwImvR1Qp
OVprsEa1S4GmC0hMZPm3PqlH0pSD17tPAXYLyB1bGJDHCH0QyyFQhYvs6UyX/mx6J0MefSoOWRf
u75N5g7VWG5Ecz7O+U0XPG+wCnpAbzw3mI5Nk4oBTclV2pvt77A4RnQrktw03fZXgR9GHyFPckv
ar57xJnJIW2BEsyXww34gjdNcHB3BBOWbX5Iu8llWXtopyOU1/SC2ZDDYDVR4slNe8LRovzDKko
IbnhYd5lNsJwdpTiTPaKk/mnIs1Fzrpay3QS8O+FeiC24tTvvWORxJKD3/7bH6G/HPK7SEltdxL
Jps
X-Received: by 2002:a05:6214:5507:b0:91c:809d:6fc0 with SMTP id
6a1803df08f44-91ca4b6a87dmr95821536d6.43.1793473709778; Sat, 31 Oct 2026
12:08:29 -0700 (PDT)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <CAFpMFfALb1KbEw-dc4wYCxS4PXfDBwzQOD6YPRe52_bpRnGt9w@mail.gmail.com>
X-Gm-Features: AclHuK8qnAk6Ire-LsUTE7cM-CRSu2ov8vhBRztZHYXYSk0WcXt94SHzYbb5Jds
X-Cc: Srujith A Poojary via GitGitGadget <gitgitgadget@gmail.com>, git@vger.kernel.org