git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Testing for existence of a remote branch from a script

From
Theodore Ts'o <tytso@mit.edu>
Date
Jan 6, 2025, 16:36 UTC
Message-ID
<20250106163636.GH1284777@mit.edu>
In-Reply-To
<xmqqsepw0xk7.fsf@gitster.g>
On Mon, Jan 06, 2025 at 07:30:32AM -0800, Junio C Hamano wrote:
>  - Would it be useful if we introduced the ability to advertise
>    "custom capabilities" from the receiving end of the connection,
>    that does not affect how the rest of Git behaves at all?

So if enhancing the git server's functionality (either via git ls-remotes or some other operation) is on the table, one of the things that I would really love is some way of asking the question is "git commit <SHA hash>" in the remote repository reachable via some branch or git tag?", and optionally, "which git branch/tag should be fetched if the testing infrastructure wants to be able to test that specific git commit ID?"

I could solve that problem by doing a "git fetch", but in my case, the specific repository in question might not even be on the local client where the user is executing "gce-xfstests -c ext4/4k -g auto --repo stable-rc.git --commit 47c2f92131c4". (This command launches a VM which actually builds the kernel, and I'd like to be able to give immediate feedback about whether the command will fail due to the user typo'ing the git commit id without either waiting for the Google Cloud VM to launch and then fail, or doing a "git fetch" and determining whether the git commit is there. I might be executing this command while on a very slow networking link, such as when I'm in an airplane or on a cruise ship, and so the cost of doing the "git fetch" might be prohibitive.)

Thanks,
						- Ted
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “Testing for existence of a remote branch from a script”
  1. Chris PackhamJan 6, 2025
  2. Torsten BögershausenJan 6, 2025
  3. Junio C HamanoJan 6, 2025
  4. Theodore Ts'oJan 6, 2025
  5. Junio C HamanoJan 6, 2025
  6. Chris PackhamJan 6, 2025
  7. Theodore Ts'oJan 6, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.