Git development
 help / color / mirror / Atom feed
* git remote set-head automatically
@ 2024-11-15 14:34 Caleb Cushing
  2024-11-16  3:36 ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Caleb Cushing @ 2024-11-15 14:34 UTC (permalink / raw)
  To: git

Context: recently I've been trying to develop a feature for my Gradle
plugin that derives a semantic version from git describe.  In order to
achieve my next level of feature I need the HEAD Branch. Now, I can
get this branch using git remote show <remote> and parsing the output.
I'm a firm believer that it should be possible for me to write code,
long term even, without the internet; I did this once with my job when
I needed to go home to my parents who were very rural and didn't have
internet; I was able to keep working without access. I want that for
anyone that uses this tool.

Problem: I don't want to have to do a network request every time I do
a build, in fact I'd rather almost never have to do a network request.
Gradle makes reducing the network request to less than once per build
something ... unsupported. jgit doesn't expose support for fetching
this information. Then I found out that you could do `git remote
set-head <remote> <branch>` which appears to behave exactly how I'd
want and expect. It doesn't easily solve my problem though because I
want my solution to be generally applicable.

Ideal Long-Term Solution: git remote set-head happens automatically on
lone, and even fetch if it's not set. Explicit setting would override
any automatic setting; and it might be a good idea to automatically
unset if the HEAD branch disappears from the remote.

Could this change be made? is there a reason not to?

Please cc, I'm not on the list.

-- 
Caleb Cushing

Appointments https://calendly.com/caleb-cushing
https://xenoterracide.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-01-12  8:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-15 14:34 git remote set-head automatically Caleb Cushing
2024-11-16  3:36 ` Jeff King
2024-11-16 15:01   ` Bence Ferdinandy
2024-11-19 15:40     ` Caleb Cushing
2024-11-19 17:06       ` Caleb Cushing
2024-11-19 18:44         ` Jeff King
2024-11-20  1:10       ` Junio C Hamano
2024-11-20  1:17       ` Junio C Hamano
2024-11-20  8:58         ` Bence Ferdinandy
2025-01-12  8:19       ` Bence Ferdinandy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox