A reflog is valid for any repo.refs
It can read/write the reflog format.
It provides a list interface to the log entries and a helper to access the shas by index specifier ( @{#}. I did not add access by date specifier here. There should probably be something that converts a date specifier into a unix timestamp.
It also provides a walker for each reflog.
If a log doesn't exist on get/set, a new reflog is created.
I would expect that all branch operations will need to hook into this. How should reflog writeback to file be handled?
Thanks for working on this. Seems like sensible approach. Two things :
It would make sense to separate out reading and writing of the reflog. When writing, we don't really want to parse all of the existing stuff but rather just append a line. When reading, it probably makes sense to deserialize the whole file like you're doing here. Reading shouldn't be necessary unless the user explicitly requests access to the reflog.
I don't understand what the point of ORDER_NONE is - it seems to have the same behaviour as ORDER_DATE?
So I'm wondering what the operations are that users would want to do on the reflog.
- Obviously, dulwich itself should be able to add entries to the reflog (preferably without reading the existing entries for performance reasons).
What are the use cases users care about? Do they actually want to have the reflog in memory or is it sufficient to just hand them an iterator over the entries in the reflog?
I've worked on a reflog implementation
https:/ /github. com/milki/ dulwich/ compare/ reflog
A reflog is valid for any repo.refs
It can read/write the reflog format.
It provides a list interface to the log entries and a helper to access the shas by index specifier ( @{#}. I did not add access by date specifier here. There should probably be something that converts a date specifier into a unix timestamp.
It also provides a walker for each reflog.
If a log doesn't exist on get/set, a new reflog is created.
I would expect that all branch operations will need to hook into this. How should reflog writeback to file be handled?
Comments? Suggestions?