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

Fix parsing of password-command option (#6268) (backport #9002) #9125

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 14, 2023

This is an automatic backport of pull request #9002 done by Mergify.
Cherry-pick of 95f48ad has failed:

On branch mergify/bp/3.10/pr-9002
Your branch is up to date with 'origin/3.10'.

You are currently cherry-picking commit 95f48ad71.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   cabal-testsuite/PackageTests/UserConfig/cabal.out
	modified:   cabal-testsuite/PackageTests/UserConfig/cabal.test.hs
	new file:   changelog.d/issue-6268
	modified:   doc/cabal-commands.rst

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   cabal-install/src/Distribution/Client/Setup.hs
	both modified:   cabal-install/src/Distribution/Deprecated/ParseUtils.hs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

The password-command option does not parse its value correctly.
Quotes are ignored, making many kinds of commands impossible to
express (e.g.  `sh -c "foo | bar"`).  Also, `cabal user-config`
treats the argument list as a *list of option values*, rather than a
*value that is a list*.  As a consequence, `cabal user-config
update` corrupts the value in the config file.

Fix these issues by parsing the command as a space separated list of
tokens, and changing the getter to `unwords` the value and return a
*singleton* list.  Also update the argument placeholder from
`PASSWORD` to `COMMAND`.

Fixes: #6268
(cherry picked from commit 95f48ad)

# Conflicts:
#	cabal-install/src/Distribution/Client/Setup.hs
#	cabal-install/src/Distribution/Deprecated/ParseUtils.hs
@ulysses4ever
Copy link
Collaborator

Ah, formatting conflict...

@Kleidukos
Copy link
Member

@ulysses4ever do you think you could handle this one?

@ulysses4ever
Copy link
Collaborator

Yes, I pushed an attempt at it.

@ulysses4ever ulysses4ever added merge me Tell Mergify Bot to merge and removed conflicts labels Jul 14, 2023
mergify bot added a commit that referenced this pull request Jul 14, 2023
@mergify mergify bot merged commit 529f850 into 3.10 Jul 14, 2023
41 checks passed
@mergify mergify bot deleted the mergify/bp/3.10/pr-9002 branch July 14, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport merge me Tell Mergify Bot to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants