# Embedding Git Command Line

5 messages from 2024-05-16 to 2024-05-21. Participants: Kevin Gale, brian m. carlson, Konstantin Khomoutov, Johannes Schindelin.
Thread: https://gitlist.dev/t/61491

## Kevin Gale, 2024-05-16 12:04

Subject: Embedding Git Command Line
Message-ID: <36B52407-B52F-4394-8DF2-F2DF3D3F0504@yahoo.co.uk>
URL: https://gitlist.dev/e/36B52407-B52F-4394-8DF2-F2DF3D3F0504%40yahoo.co.uk
In-Reply-To: <36B52407-B52F-4394-8DF2-F2DF3D3F0504.ref@yahoo.co.uk>

```
Hi.

We are looking to embed version control features into our commercially licensed proprietary product.

We haven’t made a decision on which technology yet but Git would be a popular choice.

I’ve read ‘Appendix B: Embedding Git in your applications’ on the website and determined that our choices would be either to invoke the Git command line tools or integrate with libgit2.

In theory, the command line tools should be easier to integrate with and we would rely on the user’s Git install rather than bundling the Git software.

What I would like to know is if integrating with the command line tools would still fall foul of the GPLv2 license or if there is an exception like there is for libgit2.


TIA
Kevin

```

## brian m. carlson, 2024-05-16 15:15

Subject: Re: Embedding Git Command Line
Message-ID: <ZkYjD7VGC4zLhRDF@tapette.crustytoothpaste.net>
URL: https://gitlist.dev/e/ZkYjD7VGC4zLhRDF%40tapette.crustytoothpaste.net
In-Reply-To: <36B52407-B52F-4394-8DF2-F2DF3D3F0504@yahoo.co.uk>

```
On 2024-05-16 at 12:04:35, Kevin Gale wrote:
> Hi.

Hey,

> What I would like to know is if integrating with the command line tools would still fall foul of the GPLv2 license or if there is an exception like there is for libgit2.

First of all, I'm not a lawyer and this is not legal advice.  However,
having said that, I think the common understanding is that it's fine to
call out to a GPL binary from your proprietary program without violating
the license, unless the output is a derivative work.  Usually that's not
the case; it would only usually be so if the output included part of the
GPL software's source code, such as a parser generator.  The FSF has a
FAQ[0] that covers this to some extent, which calls the approach of
calling out to the program a form of "communicat[ing] at arms length".

As a major copyright holder in Git, I don't see a problem from my
perspective with a proprietary piece of software calling out to Git as a
separate binary.  Git is designed to provide scripting interfaces so
it's easy to use from a variety of software.  You would of course need
to provide the source to the version of Git you distribute and the
copyright and license information as well, in compliance with the
license.  Note also that if you are distributing Git, you cannot link it
against GPL-incompatible software (e.g., OpenSSL) unless that
GPL-incompatible software is distributed independently as part of the
operating system.

I also want to be clear that this is my understanding as a layperson and
my interpretation as a contributor to and copyright holder in Git, but
it isn't binding on anyone else here.  If you want a legal opinion, you
need to consult a lawyer licensed in your jurisdiction who has
experience in FLOSS copyright law.  Nobody here can provide you such
an opinion.

[0] https://www.gnu.org/licenses/gpl-faq.html#GPLInProprietarySystem
-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA

```

## Konstantin Khomoutov, 2024-05-16 18:17

Subject: Re: Embedding Git Command Line
Message-ID: <20240516181738.g7iw6rfqvjfucoiw@carbon>
URL: https://gitlist.dev/e/20240516181738.g7iw6rfqvjfucoiw%40carbon
In-Reply-To: <36B52407-B52F-4394-8DF2-F2DF3D3F0504@yahoo.co.uk>

```
On Thu, May 16, 2024 at 01:04:35PM +0100, Kevin Gale wrote:

> We are looking to embed version control features into our commercially
> licensed proprietary product.
> 
> We haven’t made a decision on which technology yet but Git would be a
> popular choice.
[...]

While only tangentially related, I'd point out that if your product is going
to actually _bundle_ Git, then be prepared that it has quite a hefty set
of dependencies, so unless you're going to rely on the target OS to provide
them (which is, as I understand it, a no-go on Windows) you might be required
to invest considerable effort into that endaevor.

On the other hand, if it's not a shrink-wrap product but rather something
enterprise-y (kind of software usually installed by a dedicated technician -
as opposed to being downloaded and click-through installing by a layperson),
you might just use what Git for Windows ships, I suppose.


```

## Johannes Schindelin, 2024-05-18 19:50

Subject: Re: Embedding Git Command Line
Message-ID: <224aff4c-facc-76cd-94c1-8b40f18c0d40@gmx.de>
URL: https://gitlist.dev/e/224aff4c-facc-76cd-94c1-8b40f18c0d40%40gmx.de
In-Reply-To: <20240516181738.g7iw6rfqvjfucoiw@carbon>

```
Hi,

On Thu, 16 May 2024, Konstantin Khomoutov wrote:

> On Thu, May 16, 2024 at 01:04:35PM +0100, Kevin Gale wrote:
>
> > We are looking to embed version control features into our commercially
> > licensed proprietary product.
> >
> > We haven’t made a decision on which technology yet but Git would be a
> > popular choice.
> [...]
>
> While only tangentially related, I'd point out that if your product is going
> to actually _bundle_ Git, then be prepared that it has quite a hefty set
> of dependencies, so unless you're going to rely on the target OS to provide
> them (which is, as I understand it, a no-go on Windows) you might be required
> to invest considerable effort into that endaevor.
>
> On the other hand, if it's not a shrink-wrap product but rather something
> enterprise-y (kind of software usually installed by a dedicated technician -
> as opposed to being downloaded and click-through installing by a layperson),
> you might just use what Git for Windows ships, I suppose.

Git for Windows offers MinGit (for full details, see
https://github.com/git-for-windows/git/wiki/MinGit), which is a subset of
Git for Windows intended to be bundled by 3rd-party applications. That's
what Visual Studio and GitHub Desktop do.

Ciao,
Johannes

```

## Konstantin Khomoutov, 2024-05-21 16:00

Subject: Re: Embedding Git Command Line
Message-ID: <20240521160049.jiqpr2prvprryuuw@carbon>
URL: https://gitlist.dev/e/20240521160049.jiqpr2prvprryuuw%40carbon
In-Reply-To: <224aff4c-facc-76cd-94c1-8b40f18c0d40@gmx.de>

```
On Sat, May 18, 2024 at 09:50:00PM +0200, Johannes Schindelin wrote:

[...]
>> On the other hand, if it's not a shrink-wrap product but rather something
>> enterprise-y (kind of software usually installed by a dedicated technician -
>> as opposed to being downloaded and click-through installing by a layperson),
>> you might just use what Git for Windows ships, I suppose.
> 
> Git for Windows offers MinGit (for full details, see
> https://github.com/git-for-windows/git/wiki/MinGit), which is a subset of
> Git for Windows intended to be bundled by 3rd-party applications. That's
> what Visual Studio and GitHub Desktop do.

I've read that page and a couple related (describing MSYS[2] vs MinGW stuff
and the like) - pretty impressive. Thanks for the heads-up!


```
