New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to preserve existing header dates #185
Comments
Hi @FF-Brown, thanks for the question! No, this is not possible directly. You can use expressions (https://github.com/rubicon-oss/LicenseHeaderManager/wiki/Expendable-Properties) to insert the creation year and last modification year, which may be what you are looking for. |
@MichaelKetting Thanks for the response! That expression looks promising. Do you know where it gets the creation year from? Because if it's from the file system, the creation year would just be the year I cloned the repo rather than when the file was actually created. |
@FF-Brown ah, yes, you're correct about that. We're using the file system information and git does not update the properties based on the history. |
If this is a change that might be considered, we could update the existing %CreationYear% or add a new %GitAddYear% (and month, day, etc). Something like |
@FF-Brown Yes, contributions are welcome (https://github.com/rubicon-oss/LicenseHeaderManager/wiki/Pull-Requests) I believe new properties make the most sense (symmetric with the Creation properties), though we would need to fallback to the file's creation date if the file has not been added to Git which is true for any file that gets the license header during file creation. For performance reasons, we should only read the git log if the property is actually evaluated for a specific file. I haven't looked into how to best design this. I also recommend doing only the |
After reading through the documentation, I'm still not sure whether it's possible to do what I'm hoping for.
I've got existing headers on some files which may include either a year (2020) or a range of years (2015,2021). In these cases I'd like to preserve the starting date and add the current year to make a range (2015,2023). Any idea if this is possible with this extension?
The text was updated successfully, but these errors were encountered: