git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSoC] git-refs proposal draft

From
Yuting Zheng <05zyt30@gmail.com>
Date
Apr 1, 2025, 13:37 UTC
Message-ID
<CAMvj1+qdBb-6nDVzw1y60-C5+wknJVr=JM+4ZiAftob3Ynbs5Q@mail.gmail.com>
In-Reply-To
<Z-pjjQhtCjLvghGl@pks.im>
Hi Patrick,

Thanks for your feedback! Here are some adjustments based on your suggestions:

Show 5 quoted lines
> In any case, I don't think the naming and how exactly each of these
> commands should look and work like needs to be hashed out in this
> document. It's nice to scope out _what_ we want to achieve and propose
> how this could look like, but ultimately I think that most of the design
> should happen during the project itself.
OK! I may have misunderstood it. I will remove it.
> This one is something that is up for debate. While I do expect that most
> of the commands should remain current semantics and options, we could
> also use this as an opportunity to think whether there are any issues
> with the current design and improve upon it.

So, discussing the specific implementation of the command should also be included in the proposal, right?

Show 8 quoted lines
>> - git-refs exists
>>   Replaces git-show-ref --exists, providing reference existence checks
>>   with positive (<ref>) and exclusion-based (--exclude-existing)
>>   verification.
>
> I'm not quite clear what exclusion-based existence checks is. How do you
> check whether something exists when you exclude it? I don't think that
> this option is relevant in the context of `git refs exists`.

Sorry, I made a mistake. I meant to convey that the `--exclude-existing` option should be included in `git-refs list` (replacing `git-show-ref --exclude-existing`), which then lists refs within a certain scope.

Show 8 quoted lines
>> - git-refs resolve
>>   Replaces git-symbolic-ref, resolving symbolic references with added
>>   recursion depth control (--max-depth), while retaining deletion (-d)
>>   and quiet mode (-q) options.
>
> Not quite. The difference to `git refs show` is that this command always
> resolves the ref to an object. So it's rather more similar to `git
> rev-parse --verify`, except that it only ever handles references.
Thanks for pointing that out. I will correct it afterward.
Show 8 quoted lines
>> - git-refs pack
>>   Replaces git-pack-refs, packing loose references with support for
>>   filtering (--include, --exclude) and automatic cleanup (--prune).
>
> I would probably call this `git refs optimize` or something like that.
> git-pack-refs(1) is mostly called this way because it was introduced to
> pack refs into the "packed-refs" file. But nowadays with the reftable
> backend I think that the command name is somewhat inaccurate.
Agree with it.
Show 12 quoted lines
>> - git-refs update
>>   Replaces git-update-ref, providing transactional reference updates
>>   with batch processing (--stdin) and atomic guarantees.
>> - git-refs delete
>>   Separates the delete functionality from git-update-ref, ensuring
>>   explicit handling of reference removals with safety checks and batch
>>   operations (--stdin).
>
> It's up for debate whether we should even have something like `git refs
> delete`. As you rightfully notice `git refs update` already handles the
> usecase, so it feels like needless duplication.
>

I think maybe separate `update` and `delete` can be more direct. Separating these commands can enhance clarity in their usage, although I'm open to further discussion if the community prefers a unified command.

Show 7 quoted lines
>> 1. Option Parsing: Each subcommand will reuse the argument parsing
>>    logic from legacy commands (e.g., git-pack-refs --prune).
>
> We cannot and do not want to do this for every case. As mentioned above,
> we may want to iterate on some of the subcommands to address historic
> warts. But overall I agree, we should of course aim to reduce
> duplication as far as it is sensible to do.
Show 10 quoted lines
>
>> 2. Shared Backend Logic: Calls to common functions in refs/ (e.g.,
>>    reference traversal, locking mechanisms).
>> 3. Error Consistency: Maintain the same error codes and message
>>    formats as legacy commands.
>
> Same reasoning here, we may want to adapt some of them. The old commands
> won't go away as they are used everywhere, and that makes it more
> reasonable for us to change behaviour in their newer equivalents.
>
Got it. I will list my thoughts below.
> You don't actually have to change "git.c" to introduce new subcommands.
> We don't want `git refs-pack`, but rather `git refs pack`, which is an
> important distinction.
Sorry for my oversight. I will be more careful from now on.
Show 7 quoted lines
>> 3. Reuse refs/files-backend.c Logic:
>>    - Ensure cmd_refs_pack calls pack_refs correctly, adjusting as
>>      necessary for new options.
>
> We shouldn't have to touch any of the backends at all. You should rather
> make sure to integrate with "refs.c", which wraps the backends and
> provides a backend-agnostic interface to refs.
Got it.
Show 12 quoted lines
> You probably underestimate the time to review and land a specific change
> quite significantly. Landing new features in ~2 weeks is thus not quite
> realistic and you should allocate a lot more time for each of the
> specific subcommands.
>
> That of course raises the question of how to squeeze all of the
> subcommands into a single GSoC. And the answer is that you don't: it's
> perfectly fine to implement only a subset of the new proposed
> subcommands. I'd rather you spend more time thinking about how to
> improve upon the status quo for each of the subcommands and thus spend
> more time on it than trying to do everything in a hurry.
>

Thanks for your reminder! I plan to focus on implementing `git-refs list` and `git-refs update` first. These will form the foundation of the new design, and once stable, I will consider addressing `git-refs resolve` and additional commands if time permits.

So, I need to update my proposal to reduce the number of subcommands so that I can complete this project with high quality. I also need to further discuss the implications of these commands. By reducing the number of subcommands, I can dedicate more time to refining each one and ensuring they integrate well with the existing system. I will also detail the implications of each command in my updated proposal.

Thanks! Zheng Yuting

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 8 of 17 in “[GSoC] Proposal Discussion: git-refs Project”
  1. Yuting ZhengMar 23, 2025
  2. Patrick SteinhardtMar 24, 2025
  3. Yuting ZhengMar 27, 2025
  4. shejialuoMar 28, 2025
  5. Yuting ZhengMar 29, 2025
  6. [GSoC] git-refs proposal draftZheng Yuting, Mar 29, 2025
  7. Patrick SteinhardtMar 31, 2025
  8. Yuting ZhengApr 1, 2025
  9. Patrick SteinhardtApr 2, 2025
  10. Discussion on git-refs list Implementation and Possible ApproachesZheng Yuting, Apr 3, 2025
  11. Karthik NayakApr 4, 2025
  12. Yuting ZhengApr 4, 2025
  13. Patrick SteinhardtApr 4, 2025
  14. Yuting ZhengApr 4, 2025
  15. Yuting ZhengApr 4, 2025
  16. [GSoC] git-refs proposal v2Yuting Zheng, Apr 6, 2025
  17. Fwd: Discussion on git-refs list Implementation and Possible ApproachesYuting Zheng, Apr 4, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.