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

Re: [PATCH] environment.c: introduce DECLARE_GIT_GETTER helper macro

From
Jeff King <peff@peff.net>
Date
Mar 1, 2016, 15:05 UTC
Message-ID
<20160301150543.GN12887@sigill.intra.peff.net>
In-Reply-To
<1456601744-18404-1-git-send-email-kuleshovmail@gmail.com>
On Sun, Feb 28, 2016 at 01:35:44AM +0600, Alexander Kuleshov wrote:
Show 5 quoted lines
> +DECLARE_GIT_GETTER(const char *, get_git_dir, git_dir)
> +DECLARE_GIT_GETTER(const char *, get_git_namespace, namespace)
> +DECLARE_GIT_GETTER(char *, get_object_directory, git_object_dir)
> +DECLARE_GIT_GETTER(char *, get_index_file, git_index_file)
> +DECLARE_GIT_GETTER(char *, get_graft_file, git_graft_file)

Hmm. I'm somewhat lukewarm on this patch. It's fewer lines and less duplication, which is nice, but this kind of code generation often makes things annoying (to step into with the debugger, to find with ctags, etc). I dunno.

-Peff
Previous: Alexander KuleshovNext: Junio C Hamano
Message 2 of 3 in “environment.c: introduce DECLARE_GIT_GETTER helper macro”
  1. environment.c: introduce DECLARE_GIT_GETTER helper macroAlexander Kuleshov, Feb 27, 2016
  2. Jeff KingMar 1, 2016
  3. Junio C HamanoMar 1, 2016

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.