JetpackDuba / Gitnuro

A FOSS Git multiplatform client for newbies and pros

Home Page:https://gitnuro.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

command line parameters for opening repos

adam-ce opened this issue · comments

commented

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.

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

commented

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

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.

commented

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 :)

commented

I edited the title and description

commented

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