From: Teng Long <dyroneteng@gmail.com>
To: me@ttaylorr.com
Cc: avarab@gmail.com, derrickstolee@github.com, dyroneteng@gmail.com,
git@vger.kernel.org, gitster@pobox.com, moweng.xx@antgroup.com,
peff@peff.net, tenglong.tl@alibaba-inc.com
Subject: Re: [PATCH v2 1/1] pack-bitmap.c: avoid exposing absolute paths
Date: Thu, 3 Nov 2022 17:35:32 +0800 [thread overview]
Message-ID: <20221103093532.40511-1-tenglong.tl@alibaba-inc.com> (raw)
In-Reply-To: <Y2MWeE2f/P1iXPCY@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
> OK... here we're getting rid of the user-visible warning, which makes
> sense and is the point of this patch.
Yes, my point is to avoid exposing some sensitive informations to end- users.
> But we replace it with a trace2_data_string() that only includes the
> basename? I'd think that the point of moving this warning into
> trace2-land is that we could emit the full path without worrying about
> who sees it, since trace2 data is typically not plumbed through to
> end-users.
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.
Thanks.
> If we get later bitmap-related information in the trace2 stream, we know
> that we opened a bitmap. And at the moment we read a bitmap, there is
> only one such bitmap in the repository.
>
> I suppose that this is race-proof in the sense that if the bitmaps
> change after reading, we can still usefully debug the trace2 stream
> after the fact.
>
> So even though my first reaction was that this was unnecessary, on
> balance I do find it useful.
Yes... I think it's useful as least for me to do some bitmap tests and
I think print a bit more related information in trace2 data might be OK.
> > -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?
> Do we necessarily care about which .bitmap is read and which isn't? The
> existing test doesn't look too closely, which I think is fine (though as
> the author of that test, I might be biased ;-)).
>
> I would be equally happy to write:
>
> > + GIT_TRACE2_PERF=$(pwd)/trace2.txt git rev-list --use-bitmap-index HEAD &&
> > + grep "opened bitmap" trace2.txt &&
> > + grep "ignoring extra bitmap" trace2.txt
Orz. Actually, I wrote it on the same way, but I think it maybe not so
sufficient for my patch. So...
But I think you are right afterI look other test cases, will fix.
Thanks.
next prev parent reply other threads:[~2022-11-03 9:35 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 7:09 [PATCH 0/1] pack-bitmap.c: avoid exposing absolute paths Teng Long
2022-08-26 7:09 ` [PATCH 1/1] " Teng Long
2022-08-26 16:34 ` [PATCH 0/1] " Junio C Hamano
2022-08-29 2:48 ` Teng Long
2022-10-26 21:42 ` Taylor Blau
2022-10-26 23:19 ` Ævar Arnfjörð Bjarmason
2022-10-31 13:20 ` Teng Long
2022-10-27 20:45 ` Jeff King
2022-10-30 18:42 ` Taylor Blau
2022-10-31 12:22 ` [PATCH 0/1] pack-bitmap.c: avoid exposing absolute paths Taylor Blau <me@ttaylorr.com> writes: Teng Long
2022-11-02 5:37 ` [PATCH 0/1] pack-bitmap.c: avoid exposing absolute paths Teng Long
2022-11-02 7:54 ` Jeff King
2022-11-02 13:52 ` Teng Long
2022-10-31 13:13 ` Teng Long
2022-11-03 1:00 ` Taylor Blau
2022-11-02 9:20 ` Ævar Arnfjörð Bjarmason
2022-11-02 13:04 ` Teng Long
2022-11-02 12:56 ` [PATCH v2 " Teng Long
2022-11-02 12:56 ` [PATCH v2 1/1] " Teng Long
2022-11-03 1:16 ` Taylor Blau
2022-11-03 9:35 ` Teng Long [this message]
2022-11-05 0:35 ` Taylor Blau
2022-11-03 1:21 ` [PATCH v2 0/1] " Taylor Blau
2022-11-03 8:42 ` Teng Long
2022-11-04 3:17 ` [PATCH v3 0/2] " Teng Long
2022-11-04 3:17 ` [PATCH v3 1/2] " Teng Long
2022-11-04 22:11 ` Taylor Blau
2022-11-04 3:17 ` [PATCH v3 2/2] pack-bitmap.c: remove unnecessary "open_pack_index()" calls Teng Long
2022-11-04 22:09 ` Taylor Blau
2022-11-04 22:13 ` [PATCH v3 0/2] pack-bitmap.c: avoid exposing absolute paths Taylor Blau
2022-11-10 7:10 ` Teng Long
2022-11-10 7:10 ` [PATCH v3 1/2] pack-bitmap.c: remove unnecessary "open_pack_index()" calls Teng Long
2022-11-14 22:03 ` Jeff King
2022-11-14 22:14 ` Taylor Blau
2022-11-14 22:31 ` Jeff King
2022-11-14 22:50 ` Taylor Blau
2022-11-10 7:10 ` [PATCH v3 2/2] pack-bitmap.c: avoid exposing absolute paths Teng Long
2022-11-11 22:26 ` [PATCH v3 0/2] " Taylor Blau
2022-11-14 22:23 ` Jeff King
2022-11-17 14:19 ` Teng Long
2022-11-17 15:03 ` Jeff King
2022-11-17 21:57 ` Taylor Blau
2022-11-21 3:27 ` Teng Long
2022-11-21 12:16 ` [PATCH v4 0/4] " Teng Long
2022-11-21 12:16 ` [PATCH v4 1/4] pack-bitmap.c: remove unnecessary "open_pack_index()" calls Teng Long
2022-11-21 12:16 ` [PATCH v4 2/4] pack-bitmap.c: avoid exposing absolute paths Teng Long
2022-11-21 12:16 ` [PATCH v4 3/4] pack-bitmap.c: break out of the bitmap loop early if not tracing Teng Long
2022-11-21 23:27 ` Junio C Hamano
2022-11-28 13:09 ` Teng Long
2022-11-21 12:16 ` [PATCH v4 4/4] pack-bitmap.c: trace bitmap ignore logs when midx-bitmap is found Teng Long
2022-11-21 19:09 ` Jeff King
2022-11-21 23:29 ` Junio C Hamano
2022-11-28 12:29 ` Teng Long
2022-11-28 12:37 ` Teng Long
2022-11-29 1:27 ` Jeff King
2022-11-29 13:14 ` Teng Long
2022-11-21 19:04 ` [PATCH v4 0/4] pack-bitmap.c: avoid exposing absolute paths Jeff King
2022-11-28 12:48 ` Teng Long
2022-11-28 14:09 ` [PATCH v5 " Teng Long
2022-11-28 14:09 ` [PATCH v5 1/4] pack-bitmap.c: remove unnecessary "open_pack_index()" calls Teng Long
2022-11-28 14:09 ` [PATCH v5 2/4] pack-bitmap.c: avoid exposing absolute paths Teng Long
2022-11-28 14:09 ` [PATCH v5 3/4] pack-bitmap.c: break out of the bitmap loop early if not tracing Teng Long
2022-11-28 23:26 ` Taylor Blau
2022-11-29 13:17 ` Teng Long
2022-11-28 14:09 ` [PATCH v5 4/4] pack-bitmap.c: trace bitmap ignore logs when midx-bitmap is found Teng Long
2022-11-28 23:30 ` [PATCH v5 0/4] pack-bitmap.c: avoid exposing absolute paths Taylor Blau
2022-11-29 13:21 ` Teng Long
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221103093532.40511-1-tenglong.tl@alibaba-inc.com \
--to=dyroneteng@gmail.com \
--cc=avarab@gmail.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.com \
--cc=moweng.xx@antgroup.com \
--cc=peff@peff.net \
--cc=tenglong.tl@alibaba-inc.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).