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

[PATCH v3 21/20] convert: drop invalid comment for subprocess_entry

From
EWEric Wong <e@80x24.org>
Date
Oct 7, 2019, 08:43 UTC
Message-ID
<20191007084339.GA7808@dcvr>
In-Reply-To
<xmqqeezp490w.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Eric Wong <e@80x24.org> writes:
> 
> > Comments stating that "struct hashmap_entry" must be the first
> > member in a struct are no longer valid.
> 
> After this patch, there is one "/* must be the first member! */"
> comment left in convert.c, which is both misleading and unfortunate;
> a structure 'subprocess_entry' wants to be the first field of any
> enclosing structure, where 'subprocess_entry' has a hashmap_entry as
> its first field.

Oops, I was only grepping for hashmap_entry :x Thanks for the sharp eyes :>

Also, the first member requirement for the oidmap stuff could be lifted sometime in the future...

----8<-----
Subject: [PATCH] convert: drop invalid comment for subprocess_entry

"struct hashmap_entry" inside "struct subprocess_entry" no longer needs to be the first member of any struct, so the old comment is no longer true.

Signed-off-by: Eric Wong <e@80x24.org>
Reported-by: Junio C Hamano <gitster@pobox.com>
---
 convert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/convert.c b/convert.c
index 94ff837649..93c1e1eae9 100644
--- a/convert.c
+++ b/convert.c
@@ -753,7 +753,7 @@ static int apply_single_file_filter(const char *path, const char *src, size_t le
 #define CAP_DELAY    (1u<<2)
 
 struct cmd2process {
-	struct subprocess_entry subprocess; /* must be the first member! */
+	struct subprocess_entry subprocess;
 	unsigned int supported_capabilities;
 };
 
Previous: Junio C HamanoNext: Junio C Hamano
Message 23 of 30 in “hashmap bug/safety/ease-of-use fixes”
  1. 00/20 hashmap bug/safety/ease-of-use fixesEric Wong, Oct 6, 2019
  2. 01/20 diff: use hashmap_entry_init on moved_entry.entEric Wong, Oct 6, 2019
  3. 02/20 coccicheck: detect hashmap_entry.hash assignmentEric Wong, Oct 6, 2019
  4. 04/20 hashmap_entry_init takes "struct hashmap_entry *"Eric Wong, Oct 6, 2019
  5. 03/20 packfile: use hashmap_entry in delta_base_cache_entryEric Wong, Oct 6, 2019
  6. 05/20 hashmap_get_next takes "const struct hashmap_entry *"Eric Wong, Oct 6, 2019
  7. 06/20 hashmap_add takes "struct hashmap_entry *"Eric Wong, Oct 6, 2019
  8. 07/20 hashmap_get takes "const struct hashmap_entry *"Eric Wong, Oct 6, 2019
  9. 08/20 hashmap_remove takes "const struct hashmap_entry *"Eric Wong, Oct 6, 2019
  10. 09/20 hashmap_put takes "struct hashmap_entry *"Eric Wong, Oct 6, 2019
  11. 10/20 introduce container_of macroEric Wong, Oct 6, 2019
  12. 11/20 hashmap_get_next returns "struct hashmap_entry *"Eric Wong, Oct 6, 2019
  13. 12/20 hashmap: use *_entry APIs to wrap container_ofEric Wong, Oct 6, 2019
  14. 13/20 hashmap_get{,_from_hash} return "struct hashmap_entry *"Eric Wong, Oct 6, 2019
  15. 14/20 hashmap_cmp_fn takes hashmap_entry paramsEric Wong, Oct 6, 2019
  16. 15/20 hashmap: use *_entry APIs for iterationEric Wong, Oct 6, 2019
  17. 16/20 hashmap: hashmap_{put,remove} return hashmap_entry *Eric Wong, Oct 6, 2019
  18. 17/20 hashmap: introduce hashmap_free_entriesEric Wong, Oct 6, 2019
  19. 18/20 OFFSETOF_VAR macro to simplify hashmap iteratorsEric Wong, Oct 6, 2019
  20. 19/20 hashmap: remove type arg from hashmap_{get,put,remove}_entryEric Wong, Oct 6, 2019
  21. 20/20 hashmap_entry: remove first member requirement from docsEric Wong, Oct 6, 2019
  22. Junio C HamanoOct 7, 2019
  23. 21/20 convert: drop invalid comment for subprocess_entryEric Wong, Oct 7, 2019
  24. Junio C HamanoOct 8, 2019
  25. Eric WongOct 8, 2019
  26. Junio C HamanoOct 7, 2019
  27. Johannes SchindelinOct 8, 2019
  28. Derrick StoleeOct 8, 2019
  29. Derrick StoleeOct 8, 2019
  30. Junio C HamanoOct 9, 2019

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.