Re: Re* [PATCH 8/9] fast-export: respect the possibly-overridden default branch name
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 12, 2020, 15:19 UTC
- Message-ID
- <xmqqtuzg2twq.fsf@gitster.c.googlers.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.2006121518160.56@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 26 quoted lines
> Also, t9351 obviously needs to be adjusted. This one works for me: > > -- snipsnap -- > From: Junio C Hamano <gitster@pobox.com> > Date: Thu, 11 Jun 2020 08:05:38 -0700 > Subject: [PATCH] fast-export: do anonymize the primary branch name > > In a fast-export stream with --anonymize option, all the end-user > data including refnames are munged to prevent exposure, but the > 'master' branch is left intact. > ... > This is in preparation for introducing a mechanism to affect the > name of the primary branch used in the repository. Once the > mechanism is in use, the name of the primary branch won't be > 'master', and may not be allowed to be exposed. > > Signed-off-by: Junio C Hamano <gitster@pobox.com> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > --- > builtin/fast-export.c | 7 +++---- > t/t9351-fast-export-anonymize.sh | 9 +++++---- > 2 files changed, 8 insertions(+), 8 deletions(-) > ... > if (!strcmp(refname, "refs/heads/master")) > - return refname; > + return "refs/heads/ref0";
As I said already, I personally do not think that this needs to be a preparatory patch to anonymize 'master' that cannot be configured to something else into 'ref0'. This will become necessary when we make the primary branch configurable, so I think it is easier to replace the counterpart to your [PATCH 8/9] in the original series with it in the v2 series.
Regarding the update to the comment before this "special case", I would suggest to explain "why" not just "what".
Thanks.