This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-17
Channels
- # announcements (8)
- # babashka (27)
- # beginners (60)
- # biff (7)
- # calva (3)
- # cider (10)
- # cljs-dev (69)
- # clojure (18)
- # clojure-europe (12)
- # clojure-hungary (1)
- # clojure-korea (2)
- # clojure-new-zealand (12)
- # clojure-nl (1)
- # clojure-norway (80)
- # clojure-uk (9)
- # clojurescript (55)
- # cursive (69)
- # data-science (16)
- # events (5)
- # helix (11)
- # hyperfiddle (23)
- # jobs (1)
- # lsp (5)
- # malli (14)
- # matrix (1)
- # missionary (2)
- # off-topic (40)
- # portal (31)
- # re-frame (17)
- # reitit (11)
- # releases (11)
- # shadow-cljs (4)
- # squint (4)
- # tools-deps (5)
- # yamlscript (4)
What is the quickest way to programmatically check if a git pull is needed? I’m currently doing a git fetch and then a rev-list to determine if a merge is needed. Is there a nicer way? The problem I have with it is that a git pull takes too long to respond even when there are no updates. I am wondering how to speed this up.
Imagine 100s of repos(Github Classroom)
Pretty sure rev-list
is the way to go.
I have this in my zsh
theme file to show me how far the local branch and the remote have diverged:
local commits_ahead=0 commits_behind=0
read -r commits_ahead commits_behind <<<$(git rev-list --left-right --count ${current_commit_hash}...${upstream} 2> /dev/null)
Given that git pull
is just git fetch
followed by git merge
under the hood, if "git pull takes too long to respond even when there are no updates" I'm not sure why doing git fetch
followed by anything (`rev-list` or otherwise) would make much difference. If you want to check for remote changes without fetching, I think you'll want to look at git ls-remote
instead.
😞 I guess fate has decreed that this is the case. No issues. I will either parallelise or bear the time cost
maybe not exactly what you're looking for but it's an example of how to parallelize it yourself if you are so inclined https://github.com/corasaurus-hex/pull-all
If you're just looking to check as quickly as possible without fetching, here's some bb that does what I suggested above. Wouldn't be too difficult to parallelize across multiple repos:
(apply not= (map (fn [{s :out}] (subs s 0 (min 40 (count s))))
[(shell/sh "git" "ls-remote" "origin" "main")
(shell/sh "git" "rev-parse" "main")]))
Thank you all. I don’t intend to parallelise just yet. But yes, I do recognise that at a very crude level I could simply parallelise with babashka, perhaps simply partition my list into chunks of n and run them all on a future, but for now, I’ll just pay the time cost
I am like 80% on team Chronver now. Gonna wait a bit to see if I stay there, but i might start changing all my OS projects to use that. https://chronver.org/
Why is it the first thing my mind went to was worrying how this will work with interstellar travel and relativistic speeds?
the important part seems to be just that "the publisher" publish an ordered set of releases
so if I, in EST, publish 2024-05-17, it doesn't matter much that it is actually ambiguous whether i hit the deploy button on 2024-06-17 in my or another person's timezone
Spec isn't Y10K compliantThink about human lives!
Dragons are going to start flying out of date selector boxes everywhere the day 9,999 ends
Heh, it's weird that I haven't seen this question before. Made me chuckle a bit. Things I can think of: • It had a friendly, or at least a neutral, start • The relative simplicity and lack of BS in the language and the ecosystem don't make people think that suffering is the norm • On average, Clojure devs are more senior and I'd assume more open-minded • There's an active effort to keep it friendly. If someone behaves in a less-than-neutral way, attempts are made to steer that behavior in a more friendly direction
I get curious about questions some times. And some times I just ask those questions 🤓
And Clojure conferences have pretty much always had a Code of Conduct so that's sort of baked into the culture -- and this Slack has a CoC...
We're actually not - we're all pretending. Now get out of my lawn! (obviously sarcasm :D)
Working with Clojure is such a pleasant experience. And I wanna share it with other devs hoping to spark some interest. We're eager to give something and you do it normally in a very friendly way 🙂
@U04V70XH6 Are you saying we're friendly because we're regulated? :face_in_clouds:
Just in case - a CoC is not a code of laws. It's more of a description of the overall vibe in the community that moderators try to maintain, and some specific items that are necessary for that. With that being said, a mere existence of a CoC and moderators working in its scope are not enough for a community to be friendly. Nor are they necessary in general, but I'd say are definitely a requirement for large dynamic communities.

I get a sense of "we have something great here, and we want to share" which lends itself to a high level of friendliness. It's not "this language is right" or "everyone uses this language because it's the best" or "the fastest ever!"
“What is the burgling of a bank to the founding of a bank?” https://en.wikiquote.org/wiki/Bertolt_Brecht
Sometimes I also think about it, but I get scared just thinking about all the things I will have to do...