I have a text file that I'd like to track changes with. It's a file that stores values (as well as strings and arrays) and has the following format for its entries:
NAME: some_name
UNIT: some_unit
...
VALUE: 10
...
END
I've setup a repository to track changes on this file BUT now I would like to understand the change history of an entry like some_name.
I think this would be similar to understanding the change history of a function, where the user would like to understand the history of the entire function between various revisions.
I've tried the method described here with several attempts like:
git log -L '\bsome_name\b', '\bEND\b':config.txt
fatal: invalid object name '\bEND\b'.
also from here I've tried:
git log -p | grep '(\bsome_name\b)(.|\s)*?(\bEND\b)'
...which returns nothing.
UPDATE 20240818: Further attempts:
- Defined a custom hunk-header and tried using
git log -L:some_name:config.txt. This does work for some entries but does not find other entries, similar togit log -L'/some_name/','/END/':config.txt - using
git log -p -W >> test.txtI can manually inspect the output and see that the entries that are not found by the above methods are indeed there.
The answer provided by @phd should work and yet it ignores some entries.
'-L/^NAME: some_name$/,/^END$/:config.txt', also see here, It's hard to help you understand what's failing when you don't show what's failing.