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

[PATCH] Verify index file before we opportunistically update it

From
Yiannis Marangos <yiannis.marangos@gmail.com>
Date
Apr 9, 2014, 22:06 UTC
Message-ID
<1397081197-14803-1-git-send-email-yiannis.marangos@gmail.com>

This is a fix for the following bug: http://thread.gmane.org/gmane.comp.version-control.git/245946/focus=245965

I added 2 functions: verify_index_from and verify_index. They return 1 if the sha1 is correct, otherwise 0. I choose to not die if any errors are occurred because we just want to not proceed to "opportunistic update".

Some questions:
1) Is it better to have these functions as static?
2) If the answer of (1) is no, should I define verify_cache*() also?
3) If something goes wrong in verify_hdr(), it will print an error
   message, should I make a "quietly" version of it?
Yiannis Marangos (1):
  Verify index file before we opportunistically update it
 cache.h      |  3 +++
 read-cache.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 71 insertions(+), 11 deletions(-)
-- 
1.9.1
Next: Yiannis Marangos
Message 1 of 31 in “Verify index file before we opportunistically update it”
  1. Verify index file before we opportunistically update itYiannis Marangos, Apr 9, 2014
  2. Verify index file before we opportunistically update itYiannis Marangos, Apr 9, 2014
  3. Verify index file before we opportunistically update itYiannis Marangos, Apr 9, 2014
  4. Junio C HamanoApr 9, 2014
  5. Verify index file before we opportunistically update itYiannis Marangos, Apr 9, 2014
  6. Verify index file before we opportunistically update itYiannis Marangos, Apr 10, 2014
  7. Verify index file before we opportunistically update itYiannis Marangos, Apr 10, 2014
  8. Duy NguyenApr 10, 2014
  9. Yiannis MarangosApr 10, 2014
  10. Junio C HamanoApr 10, 2014
  11. Verify index file before we opportunistically update itYiannis Marangos, Apr 10, 2014
  12. 1/2 Add xpread() and xpwrite()Yiannis Marangos, Apr 10, 2014
  13. 2/2 Verify index file before we opportunistically update itYiannis Marangos, Apr 10, 2014
  14. Junio C HamanoApr 10, 2014
  15. Duy NguyenApr 11, 2014
  16. Junio C HamanoApr 11, 2014
  17. Junio C HamanoApr 11, 2014
  18. Yiannis MarangosApr 11, 2014
  19. Duy NguyenApr 12, 2014
  20. Junio C HamanoApr 12, 2014
  21. Junio C HamanoApr 12, 2014
  22. Duy NguyenApr 12, 2014
  23. Junio C HamanoApr 14, 2014
  24. Torsten BögershausenApr 11, 2014
  25. Yiannis MarangosApr 11, 2014
  26. Duy NguyenApr 11, 2014
  27. Junio C HamanoApr 10, 2014
  28. Yiannis MarangosApr 10, 2014
  29. 1/2 Add xpread()Yiannis Marangos, Apr 10, 2014
  30. Johannes SixtApr 10, 2014
  31. Junio C HamanoApr 10, 2014

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.