Skip to content

Fix gcsm alias passing the commit message as a path - #1297

Merged
fdncred merged 1 commit into
nushell:mainfrom
DavSanchez:fix/git-gcsm-signoff-message
Oct 21, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
DavSanchez:fix/git-gcsm-signoff-message

Conversation

@DavSanchez

Copy link
Copy Markdown
Contributor

gcsm was defined as:

export def gcsm [message: string] {
    git commit --all --signoff $message
}

The message is passed as a positional argument, so git treats it as a
pathspec:

$ gcsm "test message"
fatal: pathspec 'test message' did not match any files

(and if a file with that name existed, it would commit that file with no
message at all). It also duplicated gcasm's --all. In oh-my-zsh, whose
git plugin this file is ported from, it is:

alias gcsm='git commit --signoff --message'

which is exactly gcasm minus --all, so that is what this changes it to.

The abbreviation file mirrored every other alias in git-aliases.nu except
this one (and gwta, which has an argument-taking definition), so add gcsm
there as well.

@fdncred

fdncred commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

ok, let me know when you're ready

@DavSanchez
DavSanchez marked this pull request as ready for review October 21, 2026 17:23
@DavSanchez

Copy link
Copy Markdown
Contributor Author

@fdncred ready!

@fdncred

fdncred commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

looks like we have some conflicts now

`gcsm` expanded to `git commit --all --signoff $message`, which hands
the message to git as a pathspec, so it fails with "pathspec did not
match" (or commits unrelated files if a file happens to share the
name). It should mirror `gcasm` minus the `--all`, as in oh-my-zsh:

    alias gcsm='git commit --signoff --message'

Also add `gcsm` to the abbreviation file, which mirrored every other
alias in this file except this one.
@DavSanchez
DavSanchez force-pushed the fix/git-gcsm-signoff-message branch from 3842709 to e501893 Compare October 21, 2026 21:55
@DavSanchez

Copy link
Copy Markdown
Contributor Author

Fixed!

@fdncred
fdncred merged commit f5bc4cd into nushell:main Oct 21, 2026
1 check passed
@fdncred

fdncred commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

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.

2 participants