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

wrapLatestCommitMsg.fsx doesn't seem to work empty commits #169

Open
Mersho opened this issue Feb 22, 2024 · 9 comments
Open

wrapLatestCommitMsg.fsx doesn't seem to work empty commits #169

Mersho opened this issue Feb 22, 2024 · 9 comments

Comments

@Mersho
Copy link
Contributor

Mersho commented Feb 22, 2024

Steps to reproduce:

git commit -m "foo: testing
>
> This is a so long long long long long long long long long long long long long long long long long commmit" --allow-empty
  1. dotnet fsi .\scripts\wrapLatestCommitMsg.fsx

result:

YOou asked to na mbernadn cthh ew impo/sfti xrWercaepnStc rciopmtmOintW,i nbduotw sd
oYionugr  sbor awnocuhl di sm aakhee
aidt  oefm p'tayn.d rYeosu/ wciapn/ friexpWeraatp Sycoruirp tcOonmWmiannddo wwsi't hb y- -2a lcloow-empty, orm myiotus .c
a n 
(ruesmeo v"eg itth ep ucsohm"m itto entirely  pwuibtlhi s"hg iyto urre sleotc aHlE AcDo^m"m.i
ts)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .vscode/
        package-lock.json

No changes

Error when running 'git commit --amend --message "foo: testing

This is a so long long long long long long long long long long
long long long long long long long commmit"'
Fsdk.Process+ProcessFailed: Exception of type 'Fsdk.Process+ProcessFailed' was thrown.
   at Fsdk.Process.ProcessResult.Unwrap(String errMsg)
   at Fsdk.Process.ProcessResult.UnwrapDefault()
   at <StartupCode$FSI_0005>.$FSI_0005.main@() in C:\Users\ASUS\source\repos\conventions\scripts\wrapLatestCommitMsg.fsx:line 60
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Stopped due to error

expected result:

If the commit is empty, the script should modify the commit message using the --allow-empty option.

OS: Windows
Branch: Master

@knocte
Copy link
Member

knocte commented Feb 22, 2024

You missed a very important detail when reporting a bug, what OS?
And after answering the above question, please answer this one: can it be reproduced in other OS?

@knocte
Copy link
Member

knocte commented Feb 22, 2024

If the commit is empty, the script should modify the commit message using the --allow-empty option.

No, that's not the expected result. The expected result should be to have an error that is intelligible, not this: "YOou asked to na mbernadn cthh ew impo/sfti xrWercaepnStc rciopmtmOintW,i nbduotw sd".

@Mersho
Copy link
Contributor Author

Mersho commented Feb 22, 2024

You missed a very important detail when reporting a bug, what OS? And after answering the above question, please answer this one: can it be reproduced in other OS?

Sorry for the late reply. I’m not sure if this error is exactly same on Linux. But, I think this bug is likely on other platforms because Git works the same everywhere.

Also I updated the issue description to note that I encountered this error on Windows.

@Mersho
Copy link
Contributor Author

Mersho commented Feb 22, 2024

That wired error message comes from git commit --amend output:

You asked to amend the most recent commit, but doing so would make
it empty. You can repeat your command with --allow-empty, or you can
remove the commit entirely with "git reset HEAD^".

@knocte
Copy link
Member

knocte commented Feb 22, 2024

That wired error message comes from git commit --amend output:

Why do you say this? I already know that. I never asked you where does this come from.

@Mersho
Copy link
Contributor Author

Mersho commented Feb 22, 2024

That wired error message comes from git commit --amend output:

Why do you say this? I already know that. I never asked you where does this come from.

I said that because that wired error might be an FSX bug!?

@knocte
Copy link
Member

knocte commented Feb 22, 2024

I’m not sure if this error is exactly same on Linux.

I'm not asking you WHAT DO YOU THINK ABOUT IT, I AM ASKING YOU TO TEST IT SO THAT YOU GIVE ME A CERTAIN ANSWER.

@knocte
Copy link
Member

knocte commented Feb 22, 2024

I said that because that wired error might be an FSX bug!?

I already know it is an FSX bug, but I dont know why your statement would help on that.

@Mersho
Copy link
Contributor Author

Mersho commented Feb 22, 2024

YOU GIVE ME A CERTAIN ANSWER

yes, i got the same result on ubuntu.

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

No branches or pull requests

2 participants