Skip to content

Conversation

mstv
Copy link
Member

@mstv mstv commented Jun 2, 2024

Relates to #11734 (comment)

Proposed changes

  • Turn script option {SelectedFiles} into {SelectedRelativePaths} without resolving full paths
    in order to emphasize that these paths are valid for the selected commit (and might not apply to the working directory)
  • Always replace the provided options {SelectedRelativePaths} and {LineNumber} if an according ScriptOptionsProvider exists - at least with an empty string
    Otherwise, "{SelectedRelativePaths}" was passed as is to the script, which f.i. makes VS Code open a new file with the option as name.

E.g. in order to open a file in VS Code, the following background script command can be used (if the file has not been renamed or deleted; works best with VS Code setting window.restoreWindows set to preserve):

cmd /c code . --goto {SelectedRelativePaths}:{LineNumber}

({LineNumber} may not exactly match for older commits and may not apply at all if multiple files are selected in the wrong sequence.)

Screenshots

N/A

Test methodology

  • manual

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

instead of {SelectedFiles}
always replace provided options, at least with empty string
@mstv mstv requested a review from RussKie June 11, 2024 19:15
@RussKie RussKie added this to the vNext milestone Jun 23, 2024
@mstv mstv merged commit 5489024 into gitextensions:master Jun 23, 2024
@mstv mstv deleted the feature/scripts_for_blobs branch June 23, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants