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

Re: Discussion on git-refs list Implementation and Possible Approaches

From
Yuting Zheng <05zyt30@gmail.com>
Date
Apr 4, 2025, 15:16 UTC
Message-ID
<CAMvj1+qx8DgNp7kp==YNT6eTmmdA-zyNuYRuEovk5L+eqGw8xQ@mail.gmail.com>
In-Reply-To
<20250403154404.3459805-1-05ZYT30@gmail.com>
Hi everyone,

Following the initial discussion, I’ve updated the design for the `git-refs list` subcommand. Below are the key changes and a discussion about subcommand options.

### `git-refs list implement plan`
1. Output Format:

The default output format now follows the `git-show-ref` style: `<oid> SP <ref> LF`. This avoids dependency on ODB and aligns with lightweight ref listing.

2. Option Categorization:

The functionality is now divided into three distinct types of options (filter, sort, format) that can be combined:

2.1. **Filtering options**
   - In `git-for-each-ref`:
     - `--count`
     - `--points-at=<object>`
     - `--merged[=<object>]`
     - `--no-merged[=<object>]`
     - `--contains[=<object>]`
     - `--no-contains[=<object>]`
     - `--omit-empty`
     - `--exclude=<pattern>`
     - `--include-root-refs`
   - In `git-show-ref`:
     - `--head`
     - `--branches`
     - `--tags`
     - `--exclude-existing[=<pattern>]`
2.2. **Sorting options**
   - In `git-for-each-ref`:
     - `--sort=<key>`
2.3. **Formatting options**
   - In `git-for-each-ref`:
     - `--format=<format>`
     - `--color[=<when>]`
     - `--tcl`
     - `--shell`
     - `--perl`
   - In `git-show-ref`:
     - `--dereference`
     - `--hash`

Additionally, for filtering and sorting functionality, the `--ignore-case` option from `git-for-each-ref` should be supported across the board.

**Note**: The `--verify`, `--quiet` and `--exist` options in `git-show-ref` are intended to be implemented as separate `git-refs` subcommands and are not within the scope of this discussion.

3. Implementation Approach:
Show 7 quoted lines
> ### Approach 1:
> `git-refs list` would support both filtering and formatting options,
> meaning it could provide:
> - Filtered output
> - Formatted output
> - Combined filter + format output
>

I will proceed with Approach 1 by implementing `git-refs list` as a single subcommand that combines filtering, sorting, and formatting capabilities. To establish a foundation for this, I will first develop `git-refs show` as a standalone subcommand to replace `git-show-ref --verify`. The `git-refs list` functionality will then be built on top of the `git-refs show` codebase."

## Discussion About Options
1. Legacy Formatting Options:
Should `--tcl`, `--shell`, `--perl` be retained?
2. New Options:

Have you used these legacy options or needed modern alternatives? Any pain points?

I would appreciate any feedback or alternative suggestions on the best way to structure this functionality.

Thanks! Zheng Yuting

Previous: Yuting ZhengNext: Yuting Zheng
Message 15 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.