Closed Halfwalker closed 2 months ago
I'm suspecting your version of git does not have the --pathspec-file-nul
flag that we use. I can not reproduce this using git 2.42.0. To validate this, please run the following command from inside a git repository and send me the output:
git stash push --pathspec-file-nul --pathspec-from-file
Yup, looks like it ...
❯ git --version
git version 2.25.1
❯ git stash push --pathspec-file-nul --pathspec-from-file
error: unknown option `pathspec-file-nul'
usage: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
[-u|--include-untracked] [-a|--all] [-m|--message <message>]
[--] [<pathspec>...]]
-k, --keep-index keep index
-p, --patch stash in patch mode
-q, --quiet quiet mode
-u, --include-untracked
include untracked files in stash
-a, --all include ignore files
-m, --message <message>
stash message
That's the default version for Ubuntu 20.04 focal ... Ubuntu 22.04 jammy has
❯ git --version
git version 2.34.1
Yes, that's what I expected. The git version that comes with jammy does have this option, so it works there. Given that git 1.25 (and Ubuntu 20.04) is quite old by now I personally would like to keep the current implementation with the --pathspec-file-nul
flag, but I'll leave this issue open to see what the other maintainers think about this.
@carlfriedrich @cjappl what are your opinions?
How about an alternative method behind an environment feature flag or something ? Unfortunately, at work our official images are 20.04 ... We're pushing for updates, but there's a lot of inertia to overcome. Classic argument we get is "Well, it's LTS supported for 2 more years !"
Haven't checked the implementation details and whether there might be a workaround without using this flag, but IMO we should support a major distribution's LTS version as long as it is officially maintained.
Ok, you both have convincing arguments. We should make it work for git 2.25.1.
Check list
Environment info
Problem / Steps to reproduce
Running
forgit::stash::push
via an aliasgsp=forgit::stash::push
results in the following errorThis is on Ubuntu 20.04.6 with zsh and git versions as follows
Git repo status is
Selecting either of the modified files to stash results in immediate exit to the above error.