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

command line parameters for opening repos #197

Open
adam-ce opened this issue Jan 18, 2024 · 6 comments
Open

command line parameters for opening repos #197

adam-ce opened this issue Jan 18, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@adam-ce
Copy link

adam-ce commented Jan 18, 2024

Is your feature request related to a problem? Please describe.
I often work with many repositories of a similar name, e.g. student repos for their assignments, or various pull requests etc. In these cases, i don't want to keep these repos open in gitnuro. however, i often already have the repo open in the file manager or the console. and hence, i would like to start gitnuro for that repo.

Describe the solution you'd like

  • command line parameters to open a repo in a temporary session (will open in a new window, and the session will not be stored). this one could even hide the tab.
  • command line parameter to always open in a new tab (even when an existing tab already has the repository open)
  • command line parameter to open git nuro and select an existing tab with the same repo, or open a new tab.
  • --version and --help would be also cool

Describe alternatives you've considered
file manager integration would have to be done for each system separately. but once you have the functionality described above, you can do it on your own.

@adam-ce adam-ce added the enhancement New feature or request label Jan 18, 2024
@JetpackDuba
Copy link
Owner

That should already be working unless you are using the Flatpak version, which has an open issue about it.

@adam-ce
Copy link
Author

adam-ce commented Jan 18, 2024

interesting, yes, i'm using flatpak. could you point to the bug?

I tried the jar now and it doesn't try to open the working directory as a repo, but that's easy to workaround with a custom start script.

The jar version also opens the same repo several times in separate tabs. i would expect, that it would just switch to the tab if it already exists.
image

@JetpackDuba
Copy link
Owner

Yes, it's something kinda intentional because under some circumastances having a repo opened twice can be useful.

The flatpak issue is this flathub/com.jetpackduba.Gitnuro#11
I forgot about it until recently, I have tried to fix the script but no much luck yet. I'll probably try again before the next release.

@adam-ce
Copy link
Author

adam-ce commented Jan 18, 2024

okey, fair enough :)

would be cool if you could put some command line options there to customise the behaviour. in the future this could serve e.g. for opening specific sessions etc.

also, there is no gitnuro --version or --help :)

@adam-ce adam-ce changed the title running git nuro directly from a repository command line parameters Jan 18, 2024
@adam-ce adam-ce changed the title command line parameters command line parameters for opening repos Jan 18, 2024
@adam-ce
Copy link
Author

adam-ce commented Jan 18, 2024

I edited the title and description

@adam-ce
Copy link
Author

adam-ce commented Jan 21, 2024

not sure where to put it, but gitnuro is currently not able to open repositories from within a subdir.

with git it's easy to find out whether you are in a subdir. so as a workaround i'm using this bash script:

#!/bin/bash

if [ $# -gt 0 ]; then
    java -jar ~/bin/Gitnuro.jar $(cd $1 && git rev-parse --show-toplevel)
elif git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
    java -jar ~/bin/Gitnuro.jar "$(git rev-parse --show-toplevel)"
else
    java -jar ~/bin/Gitnuro.jar
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants