Re: [Outreachy PATCH 1/2] t0410: use rev-parse to get the subtree OID
- From
- Dorine Tipo <dorine.a.tipo@gmail.com>
- Date
- Oct 15, 2026, 15:47 UTC
- Message-ID
- <atD1oFyLb0k4oFWN@Stealth>
- In-Reply-To
- <xmqqcxtcqcfa.fsf@gitster.g>
On Wed, Oct 14, 2026 at 01:01:29PM -0700, Junio C Hamano wrote:
Show 27 quoted lines
> > [devil's advocate hat on] > > That may avoid piping, but are they chekcing the same thing? If > HEAD had a tree that sorts before a_dir due to a bug, the original > test would have used that tree instead of the tree of a_dir. Later > tests may have noticed that the tree object is not what is expected > for a_dir and led to the discovery of such a bug. The new test goes > directly to a_dir so it wouldn't catch such a bug. > > [devil's advoicate hat off] > > Arguably, the use of "head -1" in the original pipeline is > unnecessary as 'repo' prepared there only has a_dir/something and > nothing else, and if the extra tree that was added by a bug sorted > after a_dir, it would have hidden such a bug, instead of catching > it. So in the sense, it would be better to assume that the tree > would be created in a shape that we expect and explicitly name the > directory we are interested in i.e., "HEAD:a_dir". > > So, one thing we may want to add to the second paragraph of the > proposed log message is that the original assumed silently that the > first tree object in ls-tree output is the tree we are intrerested > in, without even validating what path the tree was stored at, and it > would be an improvement to name 'a_dir' explicitly in the test. > >
Thank you, that makes sense. I'll add that to the second paragraph in v2. I'll wait a little to see if any changes are needed on patch 2/2, then send v2 with everything together.