threads / discuss / 60852

git-gui desktop launcher

Subject: git-gui desktop launcher

## tl;dr

11 messages between Feb 5, 2024 and Feb 12, 2024.

replies: 10people: 6as markdown or json

Tobias Boesch· Feb 5, 2024, 20:12 UTC · lore
Hello everyone,

quoting from downstream issue: https://gitlab.archlinux.org/archlinux/packaging/packages/git/-/issues/5

-------------------------

"As far as I can see git gui cannot easily be used by me on arch. A .desktop entry is missing for me. I created one that opens git gui. It also adds an entry in the "Open With..." menu of file managers (I tested only with Nautilus). Opeing git gui with this entry git gui is opened in the folder where the menu was opened. If it is a git repository git gui open it. If it is no git repository git gui opens just as if it was called from the desktop launcher. Since it took a while to create it and adds value for me I would like to share it to be added to the git package by default. It is far from being perfect. It's a first working version. For me personally it is enough. Before tweaking it further to fit the packaging standards I would like to ask if is desired to be added.

.desktop file proposal

[Desktop Entry] Name=git gui Comment=A portable graphical interface to Git Exec=/bin/bash -c 'if [[ "$0" = "/bin/bash" ]]; then git gui; else cd "$0" && git gui; fi' %F Icon=/usr/share/git-gui/lib/git-gui.ico Type=Application Terminal=false Categories=Development;

I think upstream has any interest to add this. Therefore I ask here."
-------------------------

The arch package maintainer proposed to try to to add this to upstream before just putting it into the arch package. Here I am asking if it could be added to git.

If it's worth to add it, I would take the time to improve it if there are suggestions or comments on the current version.

Best wishes and thanks for developing git. Tobias

brian m. carlson· Feb 5, 2024, 22:29 UTC · re: Tobias Boesch · lore

Re: git-gui desktop launcher

On 2024-02-05 at 20:12:10, Tobias Boesch wrote:
Show 26 quoted lines
> Hello everyone,
> 
> quoting from downstream issue:
> https://gitlab.archlinux.org/archlinux/packaging/packages/git/-/issues/5
> 
> -------------------------
> 
> "As far as I can see git gui cannot easily be used by me on arch.
> A .desktop entry is missing for me.
> I created one that opens git gui.
> It also adds an entry in the "Open With..." menu of file managers (I
> tested only with Nautilus). Opeing git gui with this entry git gui is
> opened in the folder where the menu was opened.
> If it is a git repository git gui open it. If it is no git repository
> git gui opens just as if it was called from the desktop launcher.
> Since it took a while to create it and adds value for me I would like
> to share it to be added to the git package by default.
> It is far from being perfect. It's a first working version. For me
> personally it is enough.
> Before tweaking it further to fit the packaging standards I would like
> to ask if is desired to be added.
> 
> .desktop file proposal
> 
> [Desktop Entry]
> Name=git gui

I don't know whether this is the official name of the project or not. Perhaps someone else can comment on what the capitalization and punctuation of this entry should be.

> Comment=A portable graphical interface to Git
> Exec=/bin/bash -c 'if [[ "$0" = "/bin/bash" ]]; then git gui; else cd
> "$0" && git gui; fi' %F

It's not guaranteed that bash even exists on the system, let alone that it's in /bin. For example, this wouldn't work on most of the BSDs. This would need to be templated using SHELL_PATH and written in POSIX sh (e.g., no `[[`).

> Icon=/usr/share/git-gui/lib/git-gui.ico

This would also need to be given an appropriate location based on the build parameters.

Show 12 quoted lines
> Type=Application
> Terminal=false
> Categories=Development;
> 
> 
> I think upstream has any interest to add this. Therefore I ask here."
> 
> -------------------------
> 
> The arch package maintainer proposed to try to to add this to upstream
> before just putting it into the arch package.
> Here I am asking if it could be added to git.

If you wanted to send a suitable patch for the file such that it were appropriately built as part of the build process and installed, then we could probably accept it. Such patches are usually created by using `git format-patch` on one or multiple commits and then sent using `git send-email`. You can take a look at `Documentation/SubmittingPatches` for more details.

I think such functionality would be generally useful, and probably be beneficial to a wide variety of distributors.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Junio C Hamano· Feb 6, 2024, 18:49 UTC · re: brian m. carlson · lore

Re: git-gui desktop launcher

"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> I think such functionality would be generally useful, and probably be
> beneficial to a wide variety of distributors.

How have the various distros been packaging their binaries? Would this change affect what they have done already?

As long as it does not conflict, I am all for it (i.e. we do it once and everybody benefits).

Thanks.
Dragan Simic· Feb 6, 2024, 19:12 UTC · re: Junio C Hamano · lore

Re: git-gui desktop launcher

On 2024-02-06 19:49, Junio C Hamano wrote:
Show 10 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
>> I think such functionality would be generally useful, and probably be
>> beneficial to a wide variety of distributors.
> 
> How have the various distros been packaging their binaries?  Would
> this change affect what they have done already?
> 
> As long as it does not conflict, I am all for it (i.e. we do it once
> and everybody benefits).

AFAICT, Linux distributions provided their own version(s) of the .desktop file. Perhaps the version provided by Fedora [1] could be consulted, for example, to see what's already expected there, and to provide parity in the version supplied by us.

[1] https://koji.fedoraproject.org/koji/fileinfo?rpmID=37302272&filename=git-gui.desktop

Tobias Boesch· Feb 12, 2024, 20:35 UTC · re: Dragan Simic · lore

Re: git-gui desktop launcher

On Tue, 2024-02-06 at 20:12 +0100, Dragan Simic wrote:
Show 8 quoted lines
> 
> AFAICT, Linux distributions provided their own version(s) of the
> .desktop file.  Perhaps the version provided by Fedora [1] could be
> consulted, for example, to see what's already expected there, and
> to provide parity in the version supplied by us.
> 
> [1] 
> https://koji.fedoraproject.org/koji/fileinfo?rpmID=37302272&filename=git-gui.desktop

The file contents of the fedora desktop launcher is here: /home/tobiasb/.local/share/applications/git gui.desktop

It differs
- in the program name. "Git GUI" instead of "Git Gui".
- It leaves out the "portable" in the description ;-).
- I has no option to be launched from a location in file browser (open
with...)
I will adopt mine to match their file as good as possible.
Dragan Simic· Feb 12, 2024, 21:17 UTC · re: Tobias Boesch · lore

Re: git-gui desktop launcher

Hello Tobias,
On 2024-02-12 21:35, Tobias Boesch wrote:
Show 15 quoted lines
> On Tue, 2024-02-06 at 20:12 +0100, Dragan Simic wrote:
>> 
>> AFAICT, Linux distributions provided their own version(s) of the
>> .desktop file.  Perhaps the version provided by Fedora [1] could be
>> consulted, for example, to see what's already expected there, and
>> to provide parity in the version supplied by us.
>> 
>> [1] 
>> https://koji.fedoraproject.org/koji/fileinfo?rpmID=37302272&filename=git-gui.desktop
> 
> The file contents of the fedora desktop launcher is here:
> /home/tobiasb/.local/share/applications/git gui.desktop
> 
> It differs
> - in the program name. "Git GUI" instead of "Git Gui".
To me, "GUI" looks much better than "Gui" in a window title.
> - It leaves out the "portable" in the description ;-).

Perhaps Fedora is right there, because it refers to a version packaged for a specific architecture.

> - I has no option to be launched from a location in file browser (open
> with...)

Maybe it could be better to take that approach and add the "Open with..." feature later, just to play it safe.

> I will adopt mine to match their file as good as possible.
Good luck and have fun! :)
Tobias Boesch· Feb 6, 2024, 21:14 UTC · re: brian m. carlson · lore

Re: git-gui desktop launcher

5 Feb 2024 23:29:10 brian m. carlson <sandals@crustytoothpaste.net>:
Show 11 quoted lines
> On 2024-02-05 at 20:12:10, Tobias Boesch wrote:
>>
>> .desktop file proposal
>>
>> [Desktop Entry]
>> Name=git gui
>
> I don't know whether this is the official name of the project or not.
> Perhaps someone else can comment on what the capitalization and
> punctuation of this entry should be.
>
From the official documentation [1] it reads "git-gui"
[1] https://git-scm.com/docs/git-gui
Show 9 quoted lines
>> Comment=A portable graphical interface to Git
>> Exec=/bin/bash -c 'if [[ "$0" = "/bin/bash" ]]; then git gui; else cd
>> "$0" && git gui; fi' %F
>
> It's not guaranteed that bash even exists on the system, let alone that
> it's in /bin.  For example, this wouldn't work on most of the BSDs.
> This would need to be templated using SHELL_PATH and written in POSIX
> sh (e.g., no `[[`).
>
I see. I'll try to look into it. If someone knows how to do that let me know.
Show 5 quoted lines
>> Icon=/usr/share/git-gui/lib/git-gui.ico
>
> This would also need to be given an appropriate location based on the
> build parameters.
>

Is it about the build parameters of the build of git(-gui), or about the downstream distros are building? So git leaves this empty and the packagers full this out?

Show 20 quoted lines
>> Type=Application
>> Terminal=false
>> Categories=Development;
>>
>>
>> I think upstream has any interest to add this. Therefore I ask here."
>>
>> -------------------------
>>
>> The arch package maintainer proposed to try to to add this to upstream
>> before just putting it into the arch package.
>> Here I am asking if it could be added to git.
>
> If you wanted to send a suitable patch for the file such that it were
> appropriately built as part of the build process and installed, then we
> could probably accept it. Such patches are usually created by using
> `git format-patch` on one or multiple commits and then sent using `git
> send-email`.  You can take a look at `Documentation/SubmittingPatches`
> for more details.
>
That is the plan. I don't know if I get the installation part fine for testing it, but sending a patch should be possible. Sure.
> I think such functionality would be generally useful, and probably be
> beneficial to a wide variety of distributors.
> --
Nice to hear. Thanks
brian m. carlson· Feb 6, 2024, 22:29 UTC · re: Tobias Boesch · lore

Re: git-gui desktop launcher

On 2024-02-06 at 21:14:04, Tobias Boesch wrote:
Show 18 quoted lines
> 5 Feb 2024 23:29:10 brian m. carlson <sandals@crustytoothpaste.net>:
> 
> > It's not guaranteed that bash even exists on the system, let alone that
> > it's in /bin.  For example, this wouldn't work on most of the BSDs.
> > This would need to be templated using SHELL_PATH and written in POSIX
> > sh (e.g., no `[[`).
> >
> 
> I see. I'll try to look into it. If someone knows how to do that let me know.
> 
> >> Icon=/usr/share/git-gui/lib/git-gui.ico
> >
> > This would also need to be given an appropriate location based on the
> > build parameters.
> >
> 
> Is it about the build parameters of the build of git(-gui), or about the downstream distros are building?
> So git leaves this empty and the packagers full this out?

No, this would be built by a Makefile target. You'd provide a template file and adjust it based on something like the `RUNTIME_PREFIX` value, which is used to adjust locations for data.

There's examples for scripts, such as git-instaweb, which you can use as an example of how to generate a target file based on the input. This can also be used to work with `SHELL_PATH` as I mentioned above.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Johannes Sixt· Feb 6, 2024, 06:50 UTC · re: Tobias Boesch · lore

Re: git-gui desktop launcher

Am 05.02.24 um 21:12 schrieb Tobias Boesch:
Show 23 quoted lines
> Hello everyone,
> 
> quoting from downstream issue:
> https://gitlab.archlinux.org/archlinux/packaging/packages/git/-/issues/5
> 
> -------------------------
> 
> "As far as I can see git gui cannot easily be used by me on arch.
> A .desktop entry is missing for me.
> I created one that opens git gui.
> It also adds an entry in the "Open With..." menu of file managers (I
> tested only with Nautilus). Opeing git gui with this entry git gui is
> opened in the folder where the menu was opened.
> If it is a git repository git gui open it. If it is no git repository
> git gui opens just as if it was called from the desktop launcher.
> Since it took a while to create it and adds value for me I would like
> to share it to be added to the git package by default.
> It is far from being perfect. It's a first working version. For me
> personally it is enough.
> Before tweaking it further to fit the packaging standards I would like
> to ask if is desired to be added.
> 
> .desktop file proposal

Thank you, this is certainly helpful. To get a .desktop file accepted, you would have to submit it in patch form. Additionally, since there is a dependence on the install location, it must be included in the build process.

> 
> [Desktop Entry]
> Name=git gui

When I launch the program on my openSUSE desktop, the titlebar uses the name "Git Gui". IMO, that would make it more consistent.

> Comment=A portable graphical interface to Git
I have two gripes with this Comment:
- That the program is portable is irrelevant for the user. The word need
not occur in this Comment.
- I had hoped for a more precise description. In particular, when a
program is advertised as "graphical interface to Git", then I would
expect that it can do a bit more than initialize repositories and make
commits. At a minimum, I would expect a history viewer; but Git Gui
doesn't have one. Unless you count the two "Visualize" entries in the
"Repository" menu that invoke gitk as such. So, I dunno.
Show 21 quoted lines
> Exec=/bin/bash -c 'if [[ "$0" = "/bin/bash" ]]; then git gui; else cd
> "$0" && git gui; fi' %F
> Icon=/usr/share/git-gui/lib/git-gui.ico
> Type=Application
> Terminal=false
> Categories=Development;
> 
> 
> I think upstream has any interest to add this. Therefore I ask here."
> 
> -------------------------
> 
> The arch package maintainer proposed to try to to add this to upstream
> before just putting it into the arch package.
> Here I am asking if it could be added to git.
> 
> If it's worth to add it, I would take the time to improve it if there
> are suggestions or comments on the current version.
> 
> Best wishes and thanks for developing git.
> Tobias
-- Hannes
Marc Branchaud· Feb 6, 2024, 13:57 UTC · re: Johannes Sixt · lore

Re: git-gui desktop launcher

On 2024-02-06 01:50, Johannes Sixt wrote:
Show 14 quoted lines
> 
>> Comment=A portable graphical interface to Git
> 
> I have two gripes with this Comment:
> 
> - That the program is portable is irrelevant for the user. The word need
> not occur in this Comment.
> 
> - I had hoped for a more precise description. In particular, when a
> program is advertised as "graphical interface to Git", then I would
> expect that it can do a bit more than initialize repositories and make
> commits. At a minimum, I would expect a history viewer; but Git Gui
> doesn't have one. Unless you count the two "Visualize" entries in the
> "Repository" menu that invoke gitk as such. So, I dunno.
Perhaps
	A graphical tool for creating Git commits
?
		M.
Tobias Boesch· Feb 12, 2024, 20:23 UTC · re: Johannes Sixt · lore

Re: git-gui desktop launcher

On Tue, 2024-02-06 at 07:50 +0100, Johannes Sixt wrote:
Show 38 quoted lines
> Am 05.02.24 um 21:12 schrieb Tobias Boesch:
> > Hello everyone,
> > 
> > quoting from downstream issue:
> > https://gitlab.archlinux.org/archlinux/packaging/packages/git/-/issues/5
> > 
> > -------------------------
> > 
> > "As far as I can see git gui cannot easily be used by me on arch.
> > A .desktop entry is missing for me.
> > I created one that opens git gui.
> > It also adds an entry in the "Open With..." menu of file managers
> > (I
> > tested only with Nautilus). Opeing git gui with this entry git gui
> > is
> > opened in the folder where the menu was opened.
> > If it is a git repository git gui open it. If it is no git
> > repository
> > git gui opens just as if it was called from the desktop launcher.
> > Since it took a while to create it and adds value for me I would
> > like
> > to share it to be added to the git package by default.
> > It is far from being perfect. It's a first working version. For me
> > personally it is enough.
> > Before tweaking it further to fit the packaging standards I would
> > like
> > to ask if is desired to be added.
> > 
> > .desktop file proposal
> 
> Thank you, this is certainly helpful. To get a .desktop file
> accepted,
> you would have to submit it in patch form. Additionally, since there
> is
> a dependence on the install location, it must be included in the
> build
> process.
> 

I plan to work on this. It might take some time since I cannot spend much time on it.

Show 8 quoted lines
> > 
> > [Desktop Entry]
> > Name=git gui
> 
> When I launch the program on my openSUSE desktop, the titlebar uses
> the
> name "Git Gui". IMO, that would make it more consistent.
> 

"Git Gui" is fine for me. I thought I took the name from the official docs at https://git-scm.com/docs/git-gui, but there is called "git- gui".

Show 16 quoted lines
> > Comment=A portable graphical interface to Git
> 
> I have two gripes with this Comment:
> 
> - That the program is portable is irrelevant for the user. The word
> need
> not occur in this Comment.
> 
> - I had hoped for a more precise description. In particular, when a
> program is advertised as "graphical interface to Git", then I would
> expect that it can do a bit more than initialize repositories and
> make
> commits. At a minimum, I would expect a history viewer; but Git Gui
> doesn't have one. Unless you count the two "Visualize" entries in the
> "Repository" menu that invoke gitk as such. So, I dunno.
> 

This is the one line desciption of the official documentation. I would like to keep this description, to be consistent with the docs.

Show 28 quoted lines
> > Exec=/bin/bash -c 'if [[ "$0" = "/bin/bash" ]]; then git gui; else
> > cd
> > "$0" && git gui; fi' %F
> > Icon=/usr/share/git-gui/lib/git-gui.ico
> > Type=Application
> > Terminal=false
> > Categories=Development;
> > 
> > 
> > I think upstream has any interest to add this. Therefore I ask
> > here."
> > 
> > -------------------------
> > 
> > The arch package maintainer proposed to try to to add this to
> > upstream
> > before just putting it into the arch package.
> > Here I am asking if it could be added to git.
> > 
> > If it's worth to add it, I would take the time to improve it if
> > there
> > are suggestions or comments on the current version.
> > 
> > Best wishes and thanks for developing git.
> > Tobias
> 
> -- Hannes
> 

← back to recent threads