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

Re: [PATCH v6 2/5] reflog-walk: expose read_complete_reflog

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
May 22, 2025, 21:53 UTC
Message-ID
<2e8e7eb0-f526-49cb-8f75-379fa7ef6446@ramsayjones.plus.com>
In-Reply-To
<20250522185524.18398-4-sandals@crustytoothpaste.net>
On 22/05/2025 19:55, brian m. carlson wrote:
Show 63 quoted lines
> In a future commit, we'll use this function and the corresponding free
> function to read the entire reflog.  Expose it in the header so we can
> do so.
> 
> Include the appropriate header files so that our header is complete.
> 
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
>  reflog-walk.c | 17 ++---------------
>  reflog-walk.h | 18 ++++++++++++++++++
>  2 files changed, 20 insertions(+), 15 deletions(-)
> 
> diff --git a/reflog-walk.c b/reflog-walk.c
> index c7070b13b0..b7a9d70966 100644
> --- a/reflog-walk.c
> +++ b/reflog-walk.c
> @@ -9,19 +9,6 @@
>  #include "string-list.h"
>  #include "reflog-walk.h"
>  
> -struct complete_reflogs {
> -	char *ref;
> -	char *short_ref;
> -	struct reflog_info {
> -		struct object_id ooid, noid;
> -		char *email;
> -		timestamp_t timestamp;
> -		int tz;
> -		char *message;
> -	} *items;
> -	int nr, alloc;
> -};
> -
>  static int read_one_reflog(struct object_id *ooid, struct object_id *noid,
>  		const char *email, timestamp_t timestamp, int tz,
>  		const char *message, void *cb_data)
> @@ -41,7 +28,7 @@ static int read_one_reflog(struct object_id *ooid, struct object_id *noid,
>  	return 0;
>  }
>  
> -static void free_complete_reflog(struct complete_reflogs *array)
> +void free_complete_reflog(struct complete_reflogs *array)
>  {
>  	int i;
>  
> @@ -64,7 +51,7 @@ static void complete_reflogs_clear(void *util, const char *str UNUSED)
>  	free_complete_reflog(array);
>  }
>  
> -static struct complete_reflogs *read_complete_reflog(const char *ref)
> +struct complete_reflogs *read_complete_reflog(const char *ref)
>  {
>  	struct complete_reflogs *reflogs =
>  		xcalloc(1, sizeof(struct complete_reflogs));
> diff --git a/reflog-walk.h b/reflog-walk.h
> index 989583dc55..8f0640f662 100644
> --- a/reflog-walk.h
> +++ b/reflog-walk.h
> @@ -1,9 +1,24 @@
>  #ifndef REFLOG_WALK_H
>  #define REFLOG_WALK_H
>  
> +#include "git-compat-util.h"

Why? 'git-compat-util.h' must be #include-d in any compilation unit before 'reflog-walk.h', so ...

(Sorry, I have not studied these patches, they were just floating in front of my eyes ... so, please ignore me if the reason is obvious! :) ).

ATB, Ramsay Jones

Show 29 quoted lines
> +#include "hash.h"
> +
>  struct commit;
>  struct reflog_walk_info;
>  struct date_mode;
> +struct complete_reflogs {
> +	char *ref;
> +	char *short_ref;
> +	struct reflog_info {
> +		struct object_id ooid, noid;
> +		char *email;
> +		timestamp_t timestamp;
> +		int tz;
> +		char *message;
> +	} *items;
> +	int nr, alloc;
> +};
>  
>  void init_reflog_walk(struct reflog_walk_info **info);
>  void reflog_walk_info_release(struct reflog_walk_info *info);
> @@ -24,4 +39,7 @@ int reflog_walk_empty(struct reflog_walk_info *walk);
>  
>  struct commit *next_reflog_entry(struct reflog_walk_info *reflog_info);
>  
> +void free_complete_reflog(struct complete_reflogs *array);
> +struct complete_reflogs *read_complete_reflog(const char *ref);
> +
>  #endif
> 
Previous: brian m. carlsonNext: brian m. carlson
Message 35 of 72 in “Importing and exporting stashes to refs”
  1. 0/4 Importing and exporting stashes to refsbrian m. carlson, May 8, 2025
  2. 2/4 builtin/stash: factor out revision parsing into a functionbrian m. carlson, May 8, 2025
  3. Junio C HamanoMay 9, 2025
  4. 3/4 builtin/stash: provide a way to export stashes to a refbrian m. carlson, May 8, 2025
  5. Junio C HamanoMay 9, 2025
  6. Junio C HamanoMay 9, 2025
  7. Jeff KingMay 10, 2025
  8. Phillip WoodMay 12, 2025
  9. Junio C HamanoMay 12, 2025
  10. 1/4 object-name: make get_oid quietly return an errorbrian m. carlson, May 8, 2025
  11. Junio C HamanoMay 9, 2025
  12. brian m. carlsonMay 9, 2025
  13. 4/4 builtin/stash: provide a way to import stashes from a refbrian m. carlson, May 8, 2025
  14. Junio C HamanoMay 9, 2025
  15. brian m. carlsonMay 11, 2025
  16. Jeff KingMay 10, 2025
  17. Junio C HamanoMay 12, 2025
  18. Jeff KingMay 12, 2025
  19. Junio C HamanoMay 12, 2025
  20. brian m. carlsonMay 12, 2025
  21. Jeff KingMay 10, 2025
  22. Phillip WoodMay 12, 2025
  23. Junio C HamanoMay 9, 2025
  24. brian m. carlsonMay 9, 2025
  25. D. Ben KnobleMay 9, 2025
  26. brian m. carlsonMay 9, 2025
  27. D. Ben KnobleMay 10, 2025
  28. Makefile: avoid constant rebuilds with compilation databasebrian m. carlson, May 22, 2025
  29. 3/5 builtin/stash: factor out revision parsing into a functionbrian m. carlson, May 22, 2025
  30. Junio C HamanoMay 22, 2025
  31. brian m. carlsonMay 23, 2025
  32. Junio C HamanoMay 24, 2025
  33. brian m. carlsonMay 26, 2025
  34. 2/5 reflog-walk: expose read_complete_reflogbrian m. carlson, May 22, 2025
  35. Ramsay JonesMay 22, 2025
  36. brian m. carlsonMay 23, 2025
  37. Ramsay JonesMay 24, 2025
  38. brian m. carlsonMay 26, 2025
  39. Phillip WoodMay 29, 2025
  40. Junio C HamanoMay 29, 2025
  41. 0/5 Importing and exporting stashes to refsbrian m. carlson, May 22, 2025
  42. 0/4 Importing and exporting stashes to refsbrian m. carlson, Jun 1, 2025
  43. 1/4 object-name: make get_oid quietly return an errorbrian m. carlson, Jun 1, 2025
  44. 2/4 builtin/stash: factor out revision parsing into a functionbrian m. carlson, Jun 1, 2025
  45. 4/4 builtin/stash: provide a way to import stashes from a refbrian m. carlson, Jun 1, 2025
  46. 3/4 builtin/stash: provide a way to export stashes to a refbrian m. carlson, Jun 1, 2025
  47. Phillip WoodJun 5, 2025
  48. Kristoffer HaugsbakkJun 11, 2025
  49. brian m. carlsonJun 11, 2025
  50. Phillip WoodJun 5, 2025
  51. 0/4 Importing and exporting stashes to refsbrian m. carlson, Jun 12, 2025
  52. 2/4 builtin/stash: factor out revision parsing into a functionbrian m. carlson, Jun 12, 2025
  53. 1/4 object-name: make get_oid quietly return an errorbrian m. carlson, Jun 12, 2025
  54. 3/4 builtin/stash: provide a way to export stashes to a refbrian m. carlson, Jun 12, 2025
  55. 4/4 builtin/stash: provide a way to import stashes from a refbrian m. carlson, Jun 12, 2025
  56. Phillip WoodJun 25, 2025
  57. Junio C HamanoJun 25, 2025
  58. 1/5 object-name: make get_oid quietly return an errorbrian m. carlson, May 22, 2025
  59. Junio C HamanoMay 22, 2025
  60. 5/5 builtin/stash: provide a way to import stashes from a refbrian m. carlson, May 22, 2025
  61. Junio C HamanoMay 22, 2025
  62. brian m. carlsonMay 26, 2025
  63. Junio C HamanoMay 22, 2025
  64. Phillip WoodMay 23, 2025
  65. 4/5 builtin/stash: provide a way to export stashes to a refbrian m. carlson, May 22, 2025
  66. Junio C HamanoMay 22, 2025
  67. brian m. carlsonMay 26, 2025
  68. Phillip WoodMay 29, 2025
  69. brian m. carlsonMay 22, 2025
  70. Junio C HamanoMay 22, 2025
  71. Kristoffer HaugsbakkJun 11, 2025
  72. brian m. carlsonJun 12, 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.