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

Re: [PATCH v2 1/4] fast-export: trivial cleanup

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 30, 2012, 18:55 UTC
Message-ID
<20121030185542.GF15167@elie.Belkin>
In-Reply-To
<1351617089-13036-2-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras wrote:
> Setting commit to commit is a no-op.
Wrong description.  This should say:
	The code uses the idiom of assigning commit to itself to quench a
	"may be used uninitialized" warning.  Luckily at least modern
	versions of gcc do not produce that warning here, so we can drop
	the self-assignment.
	This makes the code clearer to human beings, makes static
	analyzers that do not know that idiom happier, and means that
	if the code some day evolves to use this variable uninitialized
	then we will catch it.
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
With that change, for what it's worth,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Patch left unsnipped since it doesn't seem to have hit the list.
Show 17 quoted lines
> ---
>  builtin/fast-export.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/builtin/fast-export.c b/builtin/fast-export.c
> index 12220ad..065f324 100644
> --- a/builtin/fast-export.c
> +++ b/builtin/fast-export.c
> @@ -483,7 +483,7 @@ static void get_tags_and_duplicates(struct object_array *pending,
>  	for (i = 0; i < pending->nr; i++) {
>  		struct object_array_entry *e = pending->objects + i;
>  		unsigned char sha1[20];
> -		struct commit *commit = commit;
> +		struct commit *commit;
>  		char *full_name;
>  
>  		if (dwim_ref(e->name, strlen(e->name), sha1, &full_name) != 1)
Previous: Felipe ContrerasNext: Jonathan Nieder
Message 11 of 29 in “Re: [PATCH v2 4/4] fast-export: make sure refs are updated properly”
  1. Sverre RabbelierOct 30, 2012
  2. Felipe ContrerasOct 30, 2012
  3. Sverre RabbelierOct 30, 2012
  4. Felipe ContrerasOct 30, 2012
  5. Jonathan NiederOct 30, 2012
  6. Felipe ContrerasOct 30, 2012
  7. Sverre RabbelierOct 30, 2012
  8. Felipe ContrerasOct 30, 2012
  9. Sverre RabbelierOct 30, 2012
  10. Felipe ContrerasOct 30, 2012
  11. Jonathan NiederOct 30, 2012
  12. Jonathan NiederOct 30, 2012
  13. Jonathan NiederOct 30, 2012
  14. Felipe ContrerasOct 30, 2012
  15. Felipe ContrerasOct 30, 2012
  16. Jonathan NiederOct 30, 2012
  17. Felipe ContrerasOct 30, 2012
  18. Jonathan NiederOct 30, 2012
  19. Felipe ContrerasOct 30, 2012
  20. Jonathan NiederOct 30, 2012
  21. Felipe ContrerasOct 31, 2012
  22. Jonathan NiederOct 31, 2012
  23. Felipe ContrerasOct 31, 2012
  24. Jonathan NiederOct 31, 2012
  25. Felipe ContrerasOct 31, 2012
  26. Jonathan NiederOct 31, 2012
  27. Felipe ContrerasOct 31, 2012
  28. Jonathan NiederOct 31, 2012
  29. Johannes SchindelinOct 30, 2012

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.