Re: [PATCH v2 1/1] pack-bitmap.c: avoid exposing absolute paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 03, 2022 at 05:35:32PM +0800, Teng Long wrote:
> I'm not sure if trace2 data will be given to end-users, at least as I understand
> it as you, it's not. If so, your opinion is very reasonable.
>
> So... maybe we could add a new configuration like "core.hideSensitive", and
> there are some supported values , "loose", "normal " and "strict":
>
>     loose: plumbing full information in trace2, even warning.
>     normal: plumbing full information in trace2, but not warning.
>     strict: plumbing part of information in trace2, but not warning
>
> But it looks like heavy, maybe not worthy... So, currently I will remove
> basename and print the pack with path if there are no new inputs here.

trace2 data isn't sent to users. So having read this after I took a look
at the updated round, I am glad that you pursued the approach that you
did :-).

> > > -test_expect_success 'complains about multiple pack bitmaps' '
> > > +test_expect_success 'complains about multiple pack bitmaps when debugging by trace2' '
> > >  	rm -fr repo &&
> > >  	git init repo &&
> > >  	test_when_finished "rm -fr repo" &&
> > > @@ -420,8 +420,13 @@ test_expect_success 'complains about multiple pack bitmaps' '
> > >  		test_line_count = 2 packs &&
> > >  		test_line_count = 2 bitmaps &&
> > >
> > > -		git rev-list --use-bitmap-index HEAD 2>err &&
> > > -		grep "ignoring extra bitmap file" err
> > > +		ls -tr .git/objects/pack | grep -e "^pack-.*\.pack$" > sorted-packs &&
> > > +		ignored_pack="$(cat sorted-packs | awk 'NR==1{print}')" &&
> > > +		open_pack="$(cat sorted-packs | awk 'NR==2{print}')" &&
> >
> > Hmmph. This test only passes if 'ls -tr' gives us the packs in order
> > that they are read by readdir(), which doesn't seem all that portable to
> > me. At the very least, it is tightly coupled to the implementation of
> > open_pack_bitmap() and friends.
>
> Yes, because the _order_ matters here I think originally. May you explain a
> little more about _portable_ problem please?

We're depending on the loop in open_pack_bitmap() seeing packs in an
order compatible with the output of 'ls -tr' here. In other words, for
this test to pass, we care very much that the pack we collected as
"$ignored_pack" is seen *after* the pack that we designate as
"$open_pack".

Does that help?

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux