threads / discuss / 61465

git client enhancement request

Subject: git client enhancement request

## tl;dr

8 messages between May 13, 2024 and May 13, 2024.

replies: 7people: 5as markdown or json

lbdyck@gmail.com· May 13, 2024, 15:07 UTC · lore

I would like to see the option to allow the git client to request the creation of a new empty git repository on the git server without having to open the web interface to the git server to define a new repository.

Perhaps something like:  git server-repo public/private name
Thank you
Lionel B. Dyck <>< 
Github: https://github.com/lbdyck
System Z Enthusiasts Discord: https://discord.gg/sze

“Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are.”   - - - John Wooden

Sean Allred· May 13, 2024, 17:56 UTC · re: lbdyck@gmail.com · lore

Re: git client enhancement request

<lbdyck@gmail.com> writes:
Show 6 quoted lines
> I would like to see the option to allow the git client to request the
> creation of a new empty git repository on the git server without
> having to open the web interface to the git server to define a new
> repository.
>
> Perhaps something like:  git server-repo public/private name

Is this even technically feasible? My understanding is that storage implementations of each forge vary *wildly*. I don't believe this would be under Git's ability to implement as a project.

You might look into combining your preferred forge's CLI with git aliases:

  - GitHub has 'gh': https://cli.github.com
  - GitLab has 'glab' https://docs.gitlab.com/ee/editor_extensions/gitlab_cli
so you could alias
    git config alias.server-repo '!gh repo create'
to get something of what you want.

I believe GitLab also has a feature where you can create repositories just by pushing an existing repository to an empty project path.

-- 
Sean Allred
lbdyck@gmail.com· May 13, 2024, 18:02 UTC · re: Sean Allred · lore

RE: git client enhancement request

Is this technically feasible - that I don't know but it would seem to be. Since there are tools for github/gitlab/bitbucket that can do it then why not the standard git client.
I know that for GitHub I can also do it with curl (haven't checked the others).
What I'm trying to do is to have a usable wrapper around git for the novice and not require other packages.
One would think that it would be comparable to a "git push" but with the addition of the "git url" and some indication if the new repo is to be public or private. If it already exists then return an error message. And if it doesn't already exist then do whatever the current web interface to the git server does to define an empty repository. Having a requirement for an existing local repository would be reasonable for this to work.
I'm just asking if it can be done.
Thank you
Lionel B. Dyck <>< 
Github: https://github.com/lbdyck
System Z Enthusiasts Discord: https://discord.gg/sze
“Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are.”   - - - John Wooden
-----Original Message-----
From: Sean Allred <allred.sean@gmail.com> 
Sent: Monday, May 13, 2024 12:56 PM
To: lbdyck@gmail.com
Cc: git@vger.kernel.org
Subject: Re: git client enhancement request
<lbdyck@gmail.com> writes:
Show 6 quoted lines
> I would like to see the option to allow the git client to request the 
> creation of a new empty git repository on the git server without 
> having to open the web interface to the git server to define a new 
> repository.
>
> Perhaps something like:  git server-repo public/private name
Is this even technically feasible? My understanding is that storage implementations of each forge vary *wildly*. I don't believe this would be under Git's ability to implement as a project.

You might look into combining your preferred forge's CLI with git aliases:

  - GitHub has 'gh': https://cli.github.com
  - GitLab has 'glab' https://docs.gitlab.com/ee/editor_extensions/gitlab_cli
so you could alias
    git config alias.server-repo '!gh repo create'
to get something of what you want.
I believe GitLab also has a feature where you can create repositories just by pushing an existing repository to an empty project path.

-- Sean Allred

Junio C Hamano· May 13, 2024, 18:51 UTC · re: Sean Allred · lore

Re: git client enhancement request

Sean Allred <allred.sean@gmail.com> writes:
> Is this even technically feasible? My understanding is that
> storage implementations of each forge vary *wildly*. I don't believe
> this would be under Git's ability to implement as a project.

Not just "storage implementation", but some things are totally kept outside the control of Git proper, including user and repository management. Creating, deleting, and modifying authentication and authorization details of these things are outside the scope of Git, and forges build on their competing designs.

lbdyck@gmail.com· May 13, 2024, 19:00 UTC · re: Junio C Hamano · lore

RE: git client enhancement request

I have to interject here that the git client doing a push must be fully authenticated which implies to me that all the information required is available to do so and allow the server repository to be updated.

Lionel B. Dyck <>< 
Github: https://github.com/lbdyck
System Z Enthusiasts Discord: https://discord.gg/sze

“Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are.”   - - - John Wooden

-----Original Message-----
From: Junio C Hamano <gitster@pobox.com> 
Sent: Monday, May 13, 2024 1:51 PM
To: Sean Allred <allred.sean@gmail.com>
Cc: lbdyck@gmail.com; git@vger.kernel.org
Subject: Re: git client enhancement request
Sean Allred <allred.sean@gmail.com> writes:
> Is this even technically feasible? My understanding is that storage 
> implementations of each forge vary *wildly*. I don't believe this 
> would be under Git's ability to implement as a project.

Not just "storage implementation", but some things are totally kept outside the control of Git proper, including user and repository management. Creating, deleting, and modifying authentication and authorization details of these things are outside the scope of Git, and forges build on their competing designs.

brian m. carlson· May 13, 2024, 21:19 UTC · re: lbdyck@gmail.com · lore

Re: git client enhancement request

On 2024-05-13 at 19:00:14, lbdyck@gmail.com wrote:
> I have to interject here that the git client doing a push must be fully
> authenticated which implies to me that all the information required is
> available to do so and allow the server repository to be updated.

First of all, the authentication required to _create_ a repository need not be the same as to _read_ or _write_ a repository. It might require a totally different set of scopes or privileges to create a new repository, which many users will have avoided giving to their credentials for least-privilege reasons.

Second, there's no standard API to perform that functionality, and the implementation varies widely on different forges. There are also people who don't use forges at all, or use tooling like gitolite[0] that handles this differently. Adding such functionality into the Git protocol requires intertwining that functionality and the services that provide it with the standard forge API, so it's likely to be very complex for forges to implement using the same functionality as Git uses currently.

Third, we specifically try not to prioritize any individual piece of software or project here. Even if there are many common forges, we won't ship tooling that's specific to GitHub, GitLab, or Bitbucket, since that prioritizes those users over others. Since there's no standard API for this, we won't be adding any forge-specific functionality to Git.

Even if we decided to implement a standard API for doing this, it doesn't mean that forges would adopt it. Many forges don't implement `git-archive` over SSH, for example, since it's hard to cache versus using HTTP.

[0] gitolite actually allows you to create repositories by just pushing to them if you have permissions to do so in the configuration.

-- 
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
rsbecker@nexbridge.com· May 13, 2024, 19:09 UTC · re: Sean Allred · lore

RE: git client enhancement request

On Monday, May 13, 2024 1:56 PM, Sean Allred wrote:
Show 26 quoted lines
><lbdyck@gmail.com> writes:
>> I would like to see the option to allow the git client to request the
>> creation of a new empty git repository on the git server without
>> having to open the web interface to the git server to define a new
>> repository.
>>
>> Perhaps something like:  git server-repo public/private name
>
>Is this even technically feasible? My understanding is that storage implementations
>of each forge vary *wildly*. I don't believe this would be under Git's ability to
>implement as a project.
>
>You might look into combining your preferred forge's CLI with git
>aliases:
>
>  - GitHub has 'gh': https://cli.github.com
>  - GitLab has 'glab' https://docs.gitlab.com/ee/editor_extensions/gitlab_cli
>
>so you could alias
>
>    git config alias.server-repo '!gh repo create'
>
>to get something of what you want.
>
>I believe GitLab also has a feature where you can create repositories just by pushing
>an existing repository to an empty project path.

Please have a look at the github/bitbucket/gitlab/azuregit REST API for doing what you are trying to do. There is no specific "git client" function as git is symmetrical. --Randall

lbdyck@gmail.com· May 13, 2024, 19:11 UTC · re: rsbecker@nexbridge.com · lore

RE: git client enhancement request

I understand that there is currently no function such as I'm requesting - but perhaps there could be.
Lionel B. Dyck <>< 
Github: https://github.com/lbdyck
System Z Enthusiasts Discord: https://discord.gg/sze
“Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are.”   - - - John Wooden
-----Original Message-----
From: rsbecker@nexbridge.com <rsbecker@nexbridge.com> 
Sent: Monday, May 13, 2024 2:09 PM
To: 'Sean Allred' <allred.sean@gmail.com>; lbdyck@gmail.com
Cc: git@vger.kernel.org
Subject: RE: git client enhancement request
On Monday, May 13, 2024 1:56 PM, Sean Allred wrote:
Show 27 quoted lines
><lbdyck@gmail.com> writes:
>> I would like to see the option to allow the git client to request the 
>> creation of a new empty git repository on the git server without 
>> having to open the web interface to the git server to define a new 
>> repository.
>>
>> Perhaps something like:  git server-repo public/private name
>
>Is this even technically feasible? My understanding is that storage 
>implementations of each forge vary *wildly*. I don't believe this would 
>be under Git's ability to implement as a project.
>
>You might look into combining your preferred forge's CLI with git
>aliases:
>
>  - GitHub has 'gh': https://cli.github.com
>  - GitLab has 'glab' 
> https://docs.gitlab.com/ee/editor_extensions/gitlab_cli
>
>so you could alias
>
>    git config alias.server-repo '!gh repo create'
>
>to get something of what you want.
>
>I believe GitLab also has a feature where you can create repositories 
>just by pushing an existing repository to an empty project path.

Please have a look at the github/bitbucket/gitlab/azuregit REST API for doing what you are trying to do. There is no specific "git client" function as git is symmetrical. --Randall

← back to recent threads