Skip to content

Re-instate ability to provide multiple revs eg diffuse -r v1 -r v2 file #248

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bhepple
Copy link

@bhepple bhepple commented Apr 25, 2025

fix for #246

@GregLawson
Copy link

Wow! Is that all the changes it takes? The ability to have multiple -t options disappeared at the same time, any possibility it is as easy to restore? I'll have to figure out how to test this PR!

@@ -287,7 +287,9 @@ def do_command_line(self, command_line):
mode = 'modified'
if 'revision' in options:
# specified revision
revs.append((options['revision'], encoding))
print(options['revision'])

Choose a reason for hiding this comment

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

Is the print statement for debug?

Copy link
Author

Choose a reason for hiding this comment

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

thanks

@Ansa211
Copy link

Ansa211 commented May 1, 2025

@bhepple I am really looking forward for this to be merged. Just as @GregLawson mentioned, multiple related issues were introduced at the same time (#213, #214), does your solution work for them as well / could it be easily adjusted? So far the suggested solution was to go back with the old option parser: #214 (comment)

@bhepple
Copy link
Author

bhepple commented May 1, 2025

It's not going to be that simple, I think. The --tab/--separate options are of type G_OPTION_ARG_NONE rather than G_OPTION_ARG_STRING - I got lucky with changing the --revision option to G_OPTION_ARG_STRING_ARRAY and found that the processing was already in place for it.

While I'm no expert on processing Gtk.Application options, it seems it processes all options first and then all the command line arguments quite separately. I think the old code processed them together and was able to that smart thing you want - so yeah, maybe going back to the old code or equivalent might be the only way.

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.

4 participants