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

Re: Does Git now have any C struct version history tracking mechanism?

From
Nazri Ramliy <ayiehere@gmail.com>
Date
Aug 19, 2013, 05:54 UTC
Message-ID
<CAEY4ZpO3x-B7SKQa+Djtt_AfQ7y=nNBZ1sR9Gvv8d3FvQLK1PA@mail.gmail.com>
In-Reply-To
<CAHz2CGW_xR4Q193h2itCELdXEpoAxetj324ATstALHM03cSvFg@mail.gmail.com>
On Sun, Aug 18, 2013 at 6:33 PM, Zhan Jianyu <nasa4836@gmail.com> wrote:
Show 11 quoted lines
>   Such a requirement came into my mind when I am tracking a gloomy C
> struct , with lengthy list of elements which are either elaborated or
> opaque. So I use git blame to track it down and found that its
> original version is quite simple and intuitive. So I think I could
> just slice out every snapshot of this struct, reading every changelog
> , to get a better knowledge of what it is and why it should be like
> this.
>
> It seems quite helpful but the process is quite cumbersome. So I
> wonder if there is already some mechanism fulfilling my requirement in
> Git.  If it doesn't,  would it be worthy adding one ?

It's already merged to git.git's master quite recently in ed73fe56428eecd2b635473f6a517a183c4713a3 (back in June).

You'd invoke git log like this:
    $ git log -L :struct_or_function_name:filename.c

and it will show you the commits and the specific hunks that affect the struct or function name.

It's still a bit rough on the edges, for example, doing the following in git.git:

    $ git log -L :rev_cmdline_info:revision.h

Shows three commits (a765499, ca92e59 and 281eee4) where the second one does not touch the struct at all (if you do "git show ca92e59" you might gain an insight as to how -L works).

But that is not to say that it's not good. The gain really shadows the roughness.

nazri
Previous: Zhan JianyuNext: Thomas Rast
Message 2 of 4 in “Does Git now have any C struct version history tracking mechanism?”
  1. Zhan JianyuAug 18, 2013
  2. Nazri RamliyAug 19, 2013
  3. Thomas RastAug 19, 2013
  4. Nazri RamliyAug 20, 2013

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.