]> git.ipfire.org Git - thirdparty/git.git/commit
git-gui: Windows tk_getSaveFile is not useful for shortcuts
authorMark Levedahl <mlevedahl@gmail.com>
Sun, 13 Apr 2025 18:31:52 +0000 (14:31 -0400)
committerMark Levedahl <mlevedahl@gmail.com>
Sat, 19 Jul 2025 13:12:11 +0000 (09:12 -0400)
commit3c8e1fe0eaaa976aace243680b825099f687a9bd
tree068c26715d349d79e815fb6a787bcca347d9b098
parente80065ecd700334fbc9f1de31320b83a894cfa06
git-gui: Windows tk_getSaveFile is not useful for shortcuts

git-gui invokes the tk_getSaveFile dialog to determine the full
path-name of the shortcut file to create. But, on Windows, this dialog
always dereferences a shortcut (.lnk) file, as this is essentially a
soft-link to its target. If the shortcut file already exists, the dialog
returns the path-name of the target (i.e., GIT/cmd/git-gui.exe), and not
the desired shortcut file selected by the user.

There is no Windows file chooser available in Tcl/Tk that does not
dereference .lnk files, so this patch avoids using a dialog: the
shortcut to be created is on the desktop and named as "Git + Repository
Name". If this .lnk file already exists, the user must give permission
to overwrite it or the process terminates.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
lib/shortcut.tcl