Commit 7c269a7
ref-filter: move ref_sorting flags to a bitfield
Change the reverse/ignore_case/version sort flags in the ref_sorting
struct into a bitfield. Having three of them was already a bit
unwieldy, but it would be even more so if another flag needed a
function like ref_sorting_icase_all() introduced in
76f9e56 (ref-filter: apply --ignore-case to all sorting keys,
2020-05-03).
A follow-up change will introduce such a flag, so let's move this over
to a bitfield. Instead of using the usual '#define' pattern I'm using
the "enum" pattern from builtin/rebase.c's b4c8eb0 (builtin
rebase: support --quiet, 2018-09-04).
Perhaps there's a more idiomatic way of doing the "for each in list
amend mask" pattern than this "mask/on" variable combo. This function
doesn't allow us to e.g. do any arbitrary changes to the bitfield for
multiple flags, but I think in this case that's fine. The common case
is that we're calling this with a list of one.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent d094748 commit 7c269a7
File tree
5 files changed
+25
-17
lines changed- builtin
5 files changed
+25
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
742 | | - | |
| 742 | + | |
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
485 | 485 | | |
486 | 486 | | |
487 | 487 | | |
488 | | - | |
| 488 | + | |
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2362 | 2362 | | |
2363 | 2363 | | |
2364 | 2364 | | |
2365 | | - | |
| 2365 | + | |
2366 | 2366 | | |
2367 | 2367 | | |
2368 | 2368 | | |
2369 | | - | |
| 2369 | + | |
| 2370 | + | |
2370 | 2371 | | |
2371 | 2372 | | |
2372 | 2373 | | |
| |||
2377 | 2378 | | |
2378 | 2379 | | |
2379 | 2380 | | |
2380 | | - | |
| 2381 | + | |
2381 | 2382 | | |
2382 | 2383 | | |
2383 | 2384 | | |
| |||
2392 | 2393 | | |
2393 | 2394 | | |
2394 | 2395 | | |
2395 | | - | |
| 2396 | + | |
2396 | 2397 | | |
2397 | 2398 | | |
2398 | 2399 | | |
2399 | 2400 | | |
2400 | | - | |
| 2401 | + | |
| 2402 | + | |
2401 | 2403 | | |
2402 | | - | |
2403 | | - | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
2404 | 2410 | | |
2405 | 2411 | | |
2406 | 2412 | | |
| |||
2537 | 2543 | | |
2538 | 2544 | | |
2539 | 2545 | | |
2540 | | - | |
| 2546 | + | |
2541 | 2547 | | |
2542 | 2548 | | |
2543 | 2549 | | |
2544 | 2550 | | |
2545 | | - | |
| 2551 | + | |
2546 | 2552 | | |
2547 | 2553 | | |
2548 | 2554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
112 | | - | |
113 | | - | |
| 114 | + | |
| 115 | + | |
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
| |||
0 commit comments