google / git-appraise

Distributed code review system for Git repos
Apache License 2.0
5.12k stars 145 forks source link

Add timestamp flag for request, comment, accept #109

Open yawaramin opened 2 years ago

yawaramin commented 2 years ago

I propose to add an optional -timestamp flag to the following commands:

If the flag is not specified, it will default to the current timestamp. The timestamp will then be used for the request and comment JSON objects.

This will make it easy to script importing historical code reviews from other systems. No special code will be required, just normal shell commands. (User can be easily set in the shell with git config.)

ojarjur commented 2 years ago

Thanks for the suggestion!

Importing review data from other tools is an important use case and we only really support it well for GitHub pull requests (using the PR mirror).

I agree that this would make building other such import pipelines (especially one-offs) much easier, so it would be a good change.

It looks like git has settled on naming such a flag --date, so we should use that same name to maintain consistency.

It would be even better if we also supported the same environment variables that git supports (GIT_AUTHOR_DATE, and maybe GIT_COMMITTER_DATE too).