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

[PATCH v5 0/2] show-index: fix uninitialized hash function

From
Abhijeet Sonar <abhijeet.nkt@gmail.com>
Date
Nov 4, 2024, 19:29 UTC
Message-ID
<20241104192958.64310-1-abhijeet.nkt@gmail.com>
In-Reply-To
<xmqq1pzuylm6.fsf@gitster.g>

In this iteration, I have fixed some typos along with a stylistisc issue that were noted in v4.

I have also added an additional patch that adds a test for --object-format option in show-index as it was noted we don't already have any.

Abhijeet Sonar (2):
  show-index: fix uninitialized hash function
  t5300: add test for 'show-index --object-format'
 builtin/show-index.c   |  9 +++++++++
 t/t5300-pack-object.sh | 26 ++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
Range-diff against v4:
1:  c75175ad9b ! 1:  05ee1e2ea5 show-index: fix uninitialized hash function
    @@ Commit message
         In c8aed5e8da (repository: stop setting SHA1 as the default object
         hash), we got rid of the default hash algorithm for the_repository.
         Due to this change, it is now the responsibility of the callers to set
    -    thier own default when this is not present.
    +    their own default when this is not present.
     
         As stated in the docs, show-index should use SHA1 as the default hash
    -    algorithm when ran outsize of a repository. Make sure this promise is
    +    algorithm when run outside a repository. Make sure this promise is
         met by falling back to SHA1 when the_hash_algo is not present (i.e.
    -    when the command is ran outside of a repository). Also add a test that
    -    verifies this behaviour.
    +    when the command is run outside a repository). Also add a test that
    +    verifies this behavior.
     
         Signed-off-by: Abhijeet Sonar <abhijeet.nkt@gmail.com>
     
    @@ builtin/show-index.c: int cmd_show_index(int argc,
      		repo_set_hash_algo(the_repository, hash_algo);
      	}
      
    -+	// Fallback to SHA1 if we are running outside of a repository.
    -+	// TODO: Figure out and implement a way to detect the hash algorithm in use by the
    -+	//       the index file passed in and use that instead.
    ++	/*
    ++	 * Fallback to SHA1 if we are running outside of a repository.
    ++	 *
    ++	 * TODO: Figure out and implement a way to detect the hash algorithm in use by the
    ++	 *       the index file passed in and use that instead.
    ++	 */
     +	if (!the_hash_algo)
     +		repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
     +
    @@ builtin/show-index.c: int cmd_show_index(int argc,
      
      	if (fread(top_index, 2 * 4, 1, stdin) != 1)
     
    - ## rm (new) ##
    -@@
    -+#!/bin/sh
    -+
    -+echo rm $@
    -
      ## t/t5300-pack-object.sh ##
     @@ t/t5300-pack-object.sh: test_expect_success 'index-pack --strict <pack> works in non-repo' '
      	test_path_is_file foo.idx
-:  ---------- > 2:  c8a28aae55 t5300: add test for 'show-index --object-format'
-- 
2.47.0.107.g34b6ce9b30
Previous: Abhijeet SonarNext: Abhijeet Sonar
Message 12 of 27 in “show-index: fix uninitialized hash function”
  1. show-index: fix uninitialized hash functionAbhijeet Sonar, Jul 12, 2024
  2. Junio C HamanoJul 12, 2024
  3. show-index: fix uninitialized hash functionAbhijeet Sonar, Jul 15, 2024
  4. Re* [PATCH v2] show-index: fix uninitialized hash functionJunio C Hamano, Jul 15, 2024
  5. show-index: fix uninitialized hash functionAbhijeet Sonar, Oct 26, 2024
  6. Taylor BlauOct 28, 2024
  7. Patrick SteinhardtOct 28, 2024
  8. Taylor BlauOct 28, 2024
  9. show-index: fix uninitialized hash functionAbhijeet Sonar, Nov 1, 2024
  10. Junio C HamanoNov 2, 2024
  11. Abhijeet SonarNov 2, 2024
  12. 0/2 show-index: fix uninitialized hash functionAbhijeet Sonar, Nov 4, 2024
  13. 1/2 show-index: fix uninitialized hash functionAbhijeet Sonar, Nov 4, 2024
  14. 2/2 t5300: add test for 'show-index --object-format'Abhijeet Sonar, Nov 4, 2024
  15. Junio C HamanoNov 5, 2024
  16. 0/2 show-index: fix uninitialized hash functionAbhijeet Sonar, Nov 9, 2024
  17. 1/2 show-index: fix uninitialized hash functionAbhijeet Sonar, Nov 9, 2024
  18. 2/2 t5300: add test for 'show-index --object-format'Abhijeet Sonar, Nov 9, 2024
  19. Junio C HamanoNov 11, 2024
  20. Patrick SteinhardtDec 16, 2024
  21. Junio C HamanoDec 16, 2024
  22. Abhijeet SonarOct 29, 2024
  23. Abhijeet SonarOct 29, 2024
  24. Abhijeet SonarOct 26, 2024
  25. brian m. carlsonJul 15, 2024
  26. Abhijeet SonarJul 15, 2024
  27. Eric SunshineJul 12, 2024

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.