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 can setup a repsoitory and track changes on this file to see when VALUEs change, BUT how can I understand the change history of an entry like some_name? The value changing shows up but since the line with NAME: some_name doesn't change I'm not seeing it in search results. So as of now I don't see how I can see when the last time some_name changed or how many times it has changed, etc.
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.
As of now I'm working with TortoiseHg on a preliminary setup so I'm open to switching tools at this point, I'm also completely new to version-control.
In mercurial the
hg grepcommand accepts python regular expressions.So
hg grep --diff "(\bsome_name\b)(.|\s)*?(\bEND\b)"will match the text fromsome_nametoENDand will return the changes that happened within this chunk of text. Try it here and adapted from here.Also, the same can be accomplished in TortoiseHg using View>Search and putting the regex
(\bsome_name\b)(.|\s)*?(\bEND\b)in the Search field (see here).