# [GSoC] Add –no-sort option for git-for-each-ref

4 messages from 2022-01-25 to 2022-02-01. Participants: Shaoxuan Yuan, Junio C Hamano.
Thread: https://gitlist.dev/t/57304

## Shaoxuan Yuan, 2022-01-25 09:59

Subject: [GSoC] Add –no-sort option for git-for-each-ref
Message-ID: <CAJyCBOQDBMcowKZgMp2iCbWpaMJGxNH9EtbQ8e0zB67k1g9uYg@mail.gmail.com>
URL: https://gitlist.dev/e/CAJyCBOQDBMcowKZgMp2iCbWpaMJGxNH9EtbQ8e0zB67k1g9uYg%40mail.gmail.com

```
Hi git community,

I'm considering if this microproject
[https://git.github.io/Outreachy-23-Microprojects/#add-no-sort-option-for-git-for-each-ref]
 is a good option for now. I want to spend some time on it and see if
I can come up with something.

Sincerely.
Shaoxuan

```

## Shaoxuan Yuan, 2022-02-01 03:23

Subject: Re: [GSoC] Add –no-sort option for git-for-each-ref
Message-ID: <CAJyCBOTpmKCHaYEvNc1-r_Rs2OWMsyCO7P6iSeM78QcjjcPuHQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAJyCBOTpmKCHaYEvNc1-r_Rs2OWMsyCO7P6iSeM78QcjjcPuHQ%40mail.gmail.com
In-Reply-To: <CAJyCBOQDBMcowKZgMp2iCbWpaMJGxNH9EtbQ8e0zB67k1g9uYg@mail.gmail.com>

```
On Tue, Jan 25, 2022 at 5:59 PM Shaoxuan Yuan <shaoxuan.yuan02@gmail.com> wrote:
>
> Hi git community,
>
> I'm considering if this microproject
> [https://git.github.io/Outreachy-23-Microprojects/#add-no-sort-option-for-git-for-each-ref]
>  is a good option for now. I want to spend some time on it and see if
> I can come up with something.
>
> Sincerely.
> Shaoxuan

Hi git community,

Not sure if this message is overlooked, but I'm writing to see if this
microproject is
still (valid to do | worth doing) for now.

Thanks,
Shaoxuan

```

## Junio C Hamano, 2022-02-01 05:33

Subject: Re: [GSoC] Add –no-sort option for git-for-each-ref
Message-ID: <xmqqzgnbf8w6.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqzgnbf8w6.fsf%40gitster.g
In-Reply-To: <CAJyCBOTpmKCHaYEvNc1-r_Rs2OWMsyCO7P6iSeM78QcjjcPuHQ@mail.gmail.com>

```
Shaoxuan Yuan <shaoxuan.yuan02@gmail.com> writes:

> On Tue, Jan 25, 2022 at 5:59 PM Shaoxuan Yuan <shaoxuan.yuan02@gmail.com> wrote:
>>
>> Hi git community,
>>
>> I'm considering if this microproject
>> [https://git.github.io/Outreachy-23-Microprojects/#add-no-sort-option-for-git-for-each-ref]
>>  is a good option for now. I want to spend some time on it and see if
>> I can come up with something.

I am fairly negative on that entry in the micro-project list (no, it
is not your fault), because

 (1) the one that is described there is fairly useless and I do not
     think we want to take in my tree at all.

 (2) a variant that is any useful would be a bit too large for a
     micro-project

As the explanatory text there says, the code should be able to
figure out when it does not need to make an extra ref_array_sort()
call, without being told by the user.

A smaller and more appropriate "add --no-sort and when it is given,
skip the call to ref_array_sort()" is much easier to do, but it is
very much useless.

If we were to spend any project resources (both developer's time and
reviewers' time), I'd rather not to see such an option added---once
we add a feature, we'd have to maintain it.  Rather, it would be
much better use of our time to do "automatically figure out when we
do not have to sort", and with that feature, nobody needs to use the
"--no-sort" option at all.

Such an "automatically skip the call to ref_array_sort()" would be
doable by a developer who may be relatively unfamiliar with our
codebase, but is still a bit too large for a micro-project, which I
expect anybody to be able to code during a lunch break and spend
more time on review exchanges on the list.

```

## Shaoxuan Yuan, 2022-02-01 06:01

Subject: Re: [GSoC] Add –no-sort option for git-for-each-ref
Message-ID: <CAJyCBOQKyoGgo1aPfZbZ04svk0CM=aLGj=ZOBbks5-DH1RyiYQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAJyCBOQKyoGgo1aPfZbZ04svk0CM%3DaLGj%3DZOBbks5-DH1RyiYQ%40mail.gmail.com
In-Reply-To: <xmqqzgnbf8w6.fsf@gitster.g>

```
On Tue, Feb 1, 2022 at 1:33 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Shaoxuan Yuan <shaoxuan.yuan02@gmail.com> writes:
>
> > On Tue, Jan 25, 2022 at 5:59 PM Shaoxuan Yuan <shaoxuan.yuan02@gmail.com> wrote:
> >>
> >> Hi git community,
> >>
> >> I'm considering if this microproject
> >> [https://git.github.io/Outreachy-23-Microprojects/#add-no-sort-option-for-git-for-each-ref]
> >>  is a good option for now. I want to spend some time on it and see if
> >> I can come up with something.
>
> I am fairly negative on that entry in the micro-project list (no, it
> is not your fault), because
>
>  (1) the one that is described there is fairly useless and I do not
>      think we want to take in my tree at all.
>
>  (2) a variant that is any useful would be a bit too large for a
>      micro-project
>
> As the explanatory text there says, the code should be able to
> figure out when it does not need to make an extra ref_array_sort()
> call, without being told by the user.
>
> A smaller and more appropriate "add --no-sort and when it is given,
> skip the call to ref_array_sort()" is much easier to do, but it is
> very much useless.
>
> If we were to spend any project resources (both developer's time and
> reviewers' time), I'd rather not to see such an option added---once
> we add a feature, we'd have to maintain it.  Rather, it would be
> much better use of our time to do "automatically figure out when we
> do not have to sort", and with that feature, nobody needs to use the
> "--no-sort" option at all.
>
> Such an "automatically skip the call to ref_array_sort()" would be
> doable by a developer who may be relatively unfamiliar with our
> codebase, but is still a bit too large for a micro-project, which I
> expect anybody to be able to code during a lunch break and spend
> more time on review exchanges on the list.

Hi Junio,

Thanks for the reply. Understood.

Sincerely,
Shaoxuan

```
