News for hackers. Stuff that matters.
Re:Show HN: Switch Git Users CLI by Foxboron on Thursday November 12, 2020 @08:50AM (#25069789)
A 1000 line YARN lock file for something that would be roughly 20 lines of bash is amazing and terrifying at the same time.
Re:Show HN: Switch Git Users CLI by cdubzzz on Thursday November 12, 2020 @10:09AM (#25070658)
Let’s see the 20 lines of bash that replicate all the features of this utility. Should fit in an HN comment nicely.
Re:Show HN: Switch Git Users CLI by boogies on Thursday November 12, 2020 @10:39AM (#25070988)
> roughly 20 lines of bash

various permutations of which were posted an hour ago and are currently higher than this comment, so I’m confused why multiple people asked to see them ~30½ minutes ago

Re:Show HN: Switch Git Users CLI by cdubzzz on Thursday November 12, 2020 @11:00AM (#25071197)
I asked because none of the posted permutations offer the same feature set. Specifically, the nice thing about this utility (and reason for the dependencies) is interactive adding and selecting of identities. If this can replicated in bash, I am legitimately interested in seeing it, 20 lines or not.
Re:Show HN: Switch Git Users CLI by Foxboron on Thursday November 12, 2020 @11:26AM (#25071477)
Implement the `git identity` portion listed earlier with a `identity-list` utilizing `git config --get-regexp`. If you need interactivity you can tie it together with fzf and some awk.
Re:Show HN: Switch Git Users CLI by cdubzzz on Thursday November 12, 2020 @12:01PM (#25071825)
So, not a 20 line bash script and at least two big dependencies. Sounds a lot like what you were poking fun at.
Re:Show HN: Switch Git Users CLI by boogies on Thursday November 12, 2020 @12:26PM (#25072127)
> at least two big dependencies

Awk (a fraction of busybox’s 2.1 MBs) is a “big dependency”‽ Or maybe you’re saying git is‽

Edit: quote

Re:Show HN: Switch Git Users CLI by cdubzzz on Thursday November 12, 2020 @02:18PM (#25073700)
Haha ok ok. Awk as a “big” dependency is hyperbole (:

I really am interested in what it would take to pull this off with bash. I may try it myself...

Re:Show HN: Switch Git Users CLI by NateEag on Thursday November 12, 2020 @12:28PM (#25072163)
fzf is not a standard tool.
Re:Show HN: Switch Git Users CLI by Foxboron on Thursday November 12, 2020 @12:28PM (#25072161)
Well no. I don't need multiple versions of the same library to do this, neither do i need the cache engine of some v8 browser either.
Re:Show HN: Switch Git Users CLI by gnagatomo on Thursday November 12, 2020 @10:08AM (#25070644)
Can you show us your take on the bash solution?
Re:Show HN: Switch Git Users CLI by lprd on Thursday November 12, 2020 @11:45AM (#25071652)
Welcome to modern javascript development.