psi-header icon indicating copy to clipboard operation
psi-header copied to clipboard

Feature request: Get the date a file was first added to version control

Open oobleck opened this issue 2 years ago • 3 comments

Would be useful in situations when creation date date isn't resolvable.

In Git, this command will provide that date. This will span any subsequent removals and re-adds to the repo: git log --diff-filter=A --follow --format=%aI -- <fname> | tail -1

explanation

oobleck avatar Apr 17 '23 19:04 oobleck

I should also say this is a rad extension and thank you for creating it. 😄

oobleck avatar Apr 17 '23 19:04 oobleck

thanks :). I will take a look if the VSCE API supports getting this, but last time I tried hooking into it, it extended the execution time of the extension enough that VSC disabled the extension. Maybe it has improved.

Regards D

davidquinn avatar Apr 18 '23 17:04 davidquinn

Yes, I agree. It would be nice to have filecreated based on the first added version control date instead of based on the clone date. If you need support, I can contribute no problem :)

Meanwhile this feature is added, is it possible to only modify the variable when saving a file? Indeed, according to the configuration below, I have: " Copyright (c) YYYY, <<year>>, My Company",. However, I only want to update <> in order to avoid to override YYYY that I modify manually (corresponding to creation date in the version control).

  "psi-header.config": {
    "forceToTop": true,
    "blankLinesAfter": 1,
    "creationDateZero": "asIs"
  },
  "psi-header.changes-tracking": {
    "isActive": true,
    "exclude": [
      "markdown",
      "json",
      "jsonc",
      "shellscript"
    ],
    "autoHeader": "autoSave",
    "enforceHeader": true,
    "replace": [
      "Copyright"
    ],
    "updateLicenseVariables": false
  },
  "psi-header.lang-config": [
    {
      "language": "javascript",
      "begin": "/*",
      "prefix": " *",
      "suffix": "",
      "lineLength": 80,
      "end": "*/",
    },
    {
      "language": "typescript",
      "mapTo": "javascript"
    }
  ],
  "psi-header.templates": [
    {
      "language": "javascript",
      "template": [
        " Copyright (c) YYYY, <<year>>, My Company"
      ],
    },
    {
      "language": "typescript",
      "mapTo": "javascript"
    }
  ],

PierBJX avatar Jan 12 '24 00:01 PierBJX