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

Re: [RFC PATCH 2/4] rename all *_sha1 variables and make null_oid hash aware

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Oct 11, 2021, 20:07 UTC
Message-ID
<CAPig+cSJentAiOGhqKpgZgXDW9NAK3OMHhKyn6auYN7b=Vk74w@mail.gmail.com>
In-Reply-To
<20211011121757.627-3-carenas@gmail.com>

On Mon, Oct 11, 2021 at 8:18 AM Carlo Marcelo Arenas Belón <carenas@gmail.com> wrote:

Show 12 quoted lines
> Before this change, creating a branch in an SHA-256 repository would
> fail because the null_sha1 used was of the wrong size.
>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
> diff --git a/git-gui.sh b/git-gui.sh
> @@ -1820,10 +1820,14 @@ proc short_path {path} {
> +if { [get_config extensions.objectformat] eq "sha256" } {
> +       set null_oid [string repeat 0 64]
> +} else {
> +       set null_oid [string repeat 0 40]
> +}
Should this be using:
    git rev-parse --show-object-format
rather than reading the configuration directly?
Previous: Carlo Marcelo Arenas BelónNext: Pratyush Yadav
Message 5 of 14 in “git-gui: support SHA-256 repositories”
  1. 0/4 git-gui: support SHA-256 repositoriesCarlo Marcelo Arenas Belón, Oct 11, 2021
  2. 1/4 blame: prefer null_sha1 over nullid and retire laterCarlo Marcelo Arenas Belón, Oct 11, 2021
  3. Pratyush YadavOct 27, 2021
  4. 2/4 rename all *_sha1 variables and make null_oid hash awareCarlo Marcelo Arenas Belón, Oct 11, 2021
  5. Eric SunshineOct 11, 2021
  6. Pratyush YadavNov 13, 2021
  7. 3/4 expand regexp matching an oid to be hash agnosticCarlo Marcelo Arenas Belón, Oct 11, 2021
  8. Pratyush YadavNov 13, 2021
  9. 4/4 track oid_size to allow for checks that are hash agnosticCarlo Marcelo Arenas Belón, Oct 11, 2021
  10. Pratyush YadavNov 13, 2021
  11. Pratyush YadavNov 13, 2021
  12. Ævar Arnfjörð BjarmasonOct 11, 2021
  13. Carlo ArenasOct 11, 2021
  14. Pratyush YadavNov 13, 2021

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.