-
Notifications
You must be signed in to change notification settings - Fork 697
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
Return empty default when git fails #8755
Conversation
I was thinking we could do a check in |
cabal-install/src/Distribution/Client/Init/NonInteractive/Heuristics.hs
Outdated
Show resolved
Hide resolved
In the function |
I'm having trouble understanding what is going wrong exactly in the unit test. It seems to me that running |
I suspect the tests mock system calls, like cabal/cabal-install/tests/UnitTests/Distribution/Client/Init/NonInteractive.hs Lines 151 to 163 in fd09059
should be changed. a63fe9b (#7344) shows a previous adjustment, but I am not sure how to read those. There is this cabal/cabal-install/src/Distribution/Client/Init/Types.hs Lines 366 to 399 in fd09059
One of the |
I changed the unit test to include inputs, let's see what works |
Everything seems to be working, I'm just wondering how to write a separate test for this. Testing this behaviour is dependent on whether the test environment has git installed. I would assume that since all the tests passed before this change, git was in the test environment. Is there a way to run a test without git installed to see if the behaviour works? |
Is there someone who could take a look at this? |
cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs
Outdated
Show resolved
Hide resolved
cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs
Outdated
Show resolved
Hide resolved
cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs
Outdated
Show resolved
Hide resolved
cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs
Outdated
Show resolved
Hide resolved
cabal-install/src/Distribution/Client/Init/Interactive/Command.hs
Outdated
Show resolved
Hide resolved
cabal-install/src/Distribution/Client/Init/Interactive/Command.hs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs
Outdated
Show resolved
Hide resolved
cabal-install/src/Distribution/Client/Init/NonInteractive/Command.hs
Outdated
Show resolved
Hide resolved
@ffaf1 your comments seem to be stressed. Do you want to OK this one? As a bug fix, I think we should try to squeeze it in 3.10. Most egregious is Maintainer and Author fields were swapped under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job!
@ulysses4ever I would be happy to separate the fixes, I'm just not sure how to do that. Should I make two separate new PRs with the changes in each? |
No he means separate commits. Rebase on your machine to a history that you like and force push. |
Yes, Francesco is right: that's what I meant. You'd need to rebase interactively and then force-push. |
I think I did it correctly? Only changing the first commit message didn't go as I'd hoped. |
@BasLaa looks good, thank you! |
To get the future behavior now, you can configure Or you can create a dedicated github account for squash and rebase operations, and use it in different |
4cf4bad
to
58e2722
Compare
Something seems to have gone wrong with merging here, a test failed for some reason? |
Force push, sometimes CI is finicky. |
Add maybe in guess functions Adjust type in NonInteractive Change unit tests Fix whitespace Abstract guessing and remove comments Simplify guess functions Return default for cabal init author and name when git fails
4cf4bad
to
d85bf80
Compare
@Mergifyio backport 3.10 |
✅ Backports have been created
|
Return empty default when git fails (backport #8755)
As mentioned in #8478, cabal init throws an error when git is not installed as it fails to guess a default name and email for the user. Instead, it should give an empty default (or no default perhaps?) and perhaps a note.