Skip to content
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

git-gui: add support for filenames starting with tilde #1599

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rimrul
Copy link

@rimrul rimrul commented Oct 18, 2023

I've originally submitted this patch as a pull request to Pratyush's git-gui repository [1] on March 23rd, but that hasn't received any feedback in almost seven months, so I'm resubmitting it on the mailing list, with an improved patch description.

[1] prati0100/git-gui#96

cc: Pratyush Yadav me@yadavpratyush.com

When git-gui encounters a file name starting with a tilde character (~),
TCL "helpfully" expands that tilde into a (probably non-existing) users
home directory. But in git-gui we're often not dealing with user supplied
paths, where such an expansion might be expected, but actual names of files.

Prevent TCL from doing tilde expansion on these literal filenames.

This fixes git-for-windows#4349

Signed-off-by: Matthias Aßhauer <mha1993@live.de>
@rimrul
Copy link
Author

rimrul commented Oct 18, 2023

/preview

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 18, 2023

Preview email sent as pull.1599.git.1697618599405.gitgitgadget@gmail.com

@rimrul
Copy link
Author

rimrul commented Oct 18, 2023

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 18, 2023

Submitted as pull.1599.git.1697619043944.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-1599/rimrul/git-gui-tilde-filenames-v1

To fetch this version to local tag pr-1599/rimrul/git-gui-tilde-filenames-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-1599/rimrul/git-gui-tilde-filenames-v1

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 18, 2023

On the Git mailing list, Junio C Hamano wrote (reply to this):

"Matthias Aßhauer via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: =?UTF-8?q?Matthias=20A=C3=9Fhauer?= <mha1993@live.de>
>
> When git-gui encounters a file name starting with a tilde character (~),
> TCL "helpfully" expands that tilde into a (probably non-existing) users
> home directory. But in git-gui we're often not dealing with user supplied
> paths, where such an expansion might be expected, but actual names of files.
>
> Prevent TCL from doing tilde expansion on these literal filenames.

I do not have stake in git-gui (or gitk) and take the changes the
subsystem owners have decided to take from them, but I have to
wonder if this is merely robbing Peter to pay Paul?

If the above description were not "we're often not" but "the only
paths we use are repository relative, and a path that begin with a
tilde NEVER refers to somebody's home directory", then I would buy
into the change (but again, I am not even a user of git-gui, so take
this with a moderate grains of salt).

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant