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

Add option of writing module diff to file #1254

Merged
merged 9 commits into from
Mar 11, 2022

Conversation

ErikDanielsson
Copy link
Contributor

@ErikDanielsson ErikDanielsson commented Aug 9, 2021

EDIT from @ewels: Description is outdated. Usage is now via interactive prompt or --save-diff.

Original description kept below for context:


Added option of writing the diffs in nf-core modules update between a locally installed module and a remote version in two ways:

  • If --diff is specified, the user is asked whether the diffs should be displayed directly in the terminal or written to a file
  • Added --diff-file <filename> option to specify a file, without using any interactive prompts

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@codecov

This comment was marked as resolved.

Copy link
Member

@ewels ewels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self: need to think about flag naming with this to avoid potential confusion with #1312

Potentially:

  • nf-core modules update --show-diff > nf-core modules update --update-diff
  • nf-core modules update --diff > nf-core modules update --update-diff

So collapse into one file, use - to print to stdout? (or allow empty input string if that's possible?)

@ewels
Copy link
Member

ewels commented Nov 24, 2021

Coming back to this comment, update-diff sounds horrible as it sounds like an action. Maybe we stick with --show-diff but remove the --diff flag 🤔

Could also have a nf-core modules patch --show-diff flag alongside, I think that would be logical (x-ref #1312 )

@ewels
Copy link
Member

ewels commented Mar 11, 2022

ok after a bit of back and forth on this I think I'm happy - not finished yet but moving in the right direction.

  • Removed --diff entirely and rely on the interactive prompt
  • Rename --diff-file to --save-diff
  • Some other refactoring / bugfixes

Still to do before merge:

  • Fix logic when previewing diffs and saving them to a file
  • Maybe: Fix diff file output so that we can use git apply

@ewels ewels self-assigned this Mar 11, 2022
@ewels ewels self-requested a review March 11, 2022 16:19
@ewels ewels marked this pull request as draft March 11, 2022 16:19
@ewels ewels added the WIP Work in progress label Mar 11, 2022
@ewels ewels added this to the 2.3 milestone Mar 11, 2022
@ewels
Copy link
Member

ewels commented Mar 11, 2022

Can't do the git diff thing as we also need to update the modules.json file.

Unless we add the changes to that file to the diff as well 🤔

@ewels ewels marked this pull request as ready for review March 11, 2022 19:56
@ewels
Copy link
Member

ewels commented Mar 11, 2022

ok that's pretty cool, can do git apply mychanges.patch after reviewing it all..

Copy link
Contributor

@FriederikeHanssen FriederikeHanssen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sateeshperi sateeshperi merged commit 997fd52 into nf-core:dev Mar 11, 2022
@ErikDanielsson ErikDanielsson deleted the diff-file-update branch July 25, 2022 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants