This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (39)
- # aws (4)
- # babashka (18)
- # beginners (32)
- # biff (10)
- # calva (22)
- # clj-kondo (11)
- # clj-on-windows (2)
- # cljs-dev (20)
- # clojure (31)
- # clojure-europe (130)
- # clojure-norway (21)
- # clojure-spec (24)
- # clojure-uk (17)
- # clojured (2)
- # clojurescript (6)
- # conjure (1)
- # core-async (5)
- # cursive (11)
- # datalevin (1)
- # datomic (9)
- # emacs (24)
- # figwheel-main (42)
- # fulcro (6)
- # gratitude (6)
- # honeysql (8)
- # juxt (16)
- # kaocha (6)
- # lsp (235)
- # malli (2)
- # nbb (7)
- # off-topic (23)
- # other-languages (24)
- # pedestal (7)
- # reitit (6)
- # sci (1)
- # shadow-cljs (21)
- # tools-build (22)
- # tools-deps (57)
- # vim (24)
Bonjour à tous!
What’s a git superpower that you feel really clever for knowing and using?
I can’t believe I learned about
git add -i so late in the game.
Nice trick. I just use a GUI for anything slightly complex…
I’ve weaned myself off of git GUIs. Terminal only atm, so trying to pick up tricks 🙂
Yeah, I discovered the
commit -flag one by mistake, it’s nice!
I also just go directly to
git add -p a lot of the time
I’ll have a look at that.
I love the idea of
git bisect, but I never got the initial hurdle of fitting whatever I want to test into some script that tests automatically.
Many of the times that I’ve thought to use it, my problem has been e.g. visual (when did the UI suddenly start acting/looking like this?)
My Git superpowers are all via Emacs Magit, makes selective adding of changes, rebase, cherry pick, rewriting commit message, creating/branching a PR, etc all pretty trivial to do all from one tool
Guess I could use it even without scripts, but I never did, for whatever reason.
I’m with you @U05254DQM and @U04V5VAUN: magit is awesome! It’s the sole reason that I kept using emacs for a looooong time after I stopped using it for anything else. I finally decided that it was a bit silly, and also that I’d like to be more fluent in “native git”.
There is neogit for Neovim and edamagit for VS Code,not sure if they are as complete as magit, but we're pretty good when I used them I find there it too much to remember for the command line, that it limits my use of git. I like things simple 😉
Don’t we all @U05254DQM ;D I’m trying to exercise my git memory. I think it’s mostly about remembering the options that I have available, and then look up how to perform the options when I need them. It certainly has inconsistent and/or odd naming and arrangement of concepts and commands, which makes it harder.
I could use this!
Is it like a more ergonomic way of
git cloning at a different path?
When you clone something, say master/main or whatever, and it's not a bare repo, you have a worktree
for if a frontend person has their own branch in the repo, you check out that as a worktree, whilst also keeping your own worktree of your own branch of the same monorepo
Very very cool.
Does having multiple worktrees checked out at once enable some kind of easier diffing? Or maybe something related to comparing branches.
It's the same really, you're just diff'ing between directories 🙂 YOu also still can diff between branches whilst in a worktree
remember, you always have at least one work tree, the master branch (or main or whatever you call it). so the diffing is the same
wait so i've just been using local branches to do this
ah ok i get it, it's a branch <> sub-folder sync / admin system
I just used it! I was starting up the environment for one branch, and wanted to check something on a different branch. Created a worktree, checked out the correct branch, looked at the code, removed the worktree. All while my environment was building. Sweet!
nifty. honestly i just use github to read code in other branches. probably lazy that way
I do that too, but I like having options 🙂
Also, @U11EL3P9U, I installed Delta, and I’m pretty happy about the Github themed terminal diff I’m now getting! (Because I actually normally use Github for looking a diffs 😅 )
So thank you 🙌 🥳
I'm working on a project atm, with 4 different worktrees all local. I can do a bit of work on one worktree, push it for testing, then cd to another worktree, do some work there and so on...
Sometimes, I do some work, leave it there, uncommitted whilst I test locally, and whilst the tests are running, I cd to another worktree do a bit of work there and so on.
I considered doing something similar with my main work project, but it’s not really set up for that kind of stuff… Just the editor, to begin with, has a bunch of configuration stuff that I’d need to configure every time I check out a new worktree.
Me too! I use a very minimal
#!/usr/bin/env bash # .env is the source of truth for environment variables for this project, since IntelliJ can load from it using the EnvFile plugin. This file ensures that same environment variables are present in the terminal, provided that the system is using direnv. for line in $(cat .env); do eval "export $line" done
(So, not a “huge user” lol, but a user)
it's all good. I think we all strive to have a productive working environment, so every little tool helps 🙂
But adding the worktree project to IntelliJ, setting up the REPLs and such, I don’t think that’s scriptable. (But I should really look into it to make sure…)
I’ve got custom styling on github to make the diff pages take up 100% width instead of just a center column. And I’ve got a very little custom styling script in our ticket tracking system that allows me to easily pull the name of an issue, the link and the number, all in one string. It’s a tiny thing, but I use it all the time, and I’m very happy and proud of it (even if imperfect)
I use vim heavily for text editing, showing it in everywhere I can, but I like IntelliJ for Clojure (and everyone in my team uses it, so there’s a hive mind around it)
Just set it up as a man pager an hour ago!
And as I described to the other person assisting me in that, I haven’t dared “living” in neovim/vim yet, for a number of reasons. I just zoom in and out.
My usage of intellij is for kotlin/java. I do use datagrip quite a bit and pycharm too.
The Jetbrains family is generally nice, I gather
What’s your most recent text editing epiphany in vim/neovim?
I try to add a little bit of knowledge every week, but some stuff is so esoteric that it’ll end up being re-added years after. Using “o” to move the cursor into the other end of a visual selection is something I keep meaning to do, but keep forgetting, for example.
Also, maybe I haven’t had much use for it… Tend to visually select whole lines, anyway
Executing the current line in bash by hitting
!!bash is one that I’ve used loads, recently, on the other hand.
(not text editing, though :face_with_monocle:)
Nice trick. I just use a GUI for anything slightly complex…
I was not prepared for how many resource-related quirks one must work around when building an uberjar…
suddenly regular file access is turned into guess which resource path is shadowing my file now…
what sort of issues are you seeing @simongray?
@mccraigmccraig https://clojurians.slack.com/archives/C0K65B20P/p1656059501795929 Basically, Pedestal serves me random resources in libraries rather than stuff that’s on disk. I guess I need to find some classloader which only loads resources from disk and force Pedestal to use that. Yesterday I having issues resulting in some code needing to be modified, since I couldn’t use io/file on resources any longer when it was packaged as an uberjar (since those were no longer technically files), but the same code worked fine running it in the REPL. It just seems that there’s a bunch of gotchas that necessitate rewriting code to handle both the regular REPL environment and the state of being packaged as an uberjar.
since io/resource apparently
returns proxies for different types in dev and prod, i.e. files and whatever-you-call-the-things-inside-uberjars-but-it’s-definitely-not-files
io/resource scans the classpath and returns a URL, not a file. Assuming it points at a file is a mistake. If you only want things to come from the filesystem then don't use io/resource. Since resources are looked up on the classpath there is a potential for clashes. Just as we don't use (ns main) you shouldn't have an (io/resource "main.css"), that's asking for trouble. Use (io/resource "my_app/main.css") instead. If you do want to force it to prefer a certain directory on disk, then make sure that directory precedes the uberjar in the classpath. java -cp my_dir:uberjar.jar my.main.ns.
@simongray the real bug is a library putting a file in style.css.
Is it really, though…? You really can not guard against resources being named specific things. I think the apparent lack of namespacing for resources is the true issue. Everything’s apparently just in one huge global namespace…? Seems like a terrible design that we avoid otherwise in every other situation.
Both are loaded the same way as resources, by looking them up on the classpath. Both of which use directories to add unique prefixes. Resources should be treated the same way.
Made my tiny commit huge though... :face_with_rolling_eyes: https://github.com/kuhumcst/glossematics/commit/12811f7ea364fbabfe7ad9ea3c563efadddab14e
A while ago I stopped separating the two and just use
src for everything now.
I do that too increasingly, @dominicm. Haven't dared mentioning it out loud because it makes me feel heretic. 😃
It does feel scary for some reason. But I also enjoy the look on people's faces when they realise it doesn't matter 😂
my view: everything can just go in a big database and we take it from there
I saw some Haskell project where they are doing something like this. Don't recall the name of the thing right now...
that's just a search though so not as ambitious as what I'm suggesting
@pez @dominicm throwing my hat in the ring with y'all on using
src for resources
delete from "c:" where path like '\System32%';
I heard databases are just big filesystems
mmm... shiny new kit for doing data science on https://simplynuc.co.uk/product/nuc12dcmi9-full/ looking forward to lighting up all the cores
Data science is your new name for mining?
I'll take one like this if you are bitcoin mining :rolling_on_the_floor_laughing: 4TB of solid state memory should be enough
Just to be clear, data science is how I make my money. Don't have any bitcoin or other
@raymcdermott this was the thing I was remembering. Probably something totally different from your idea. It has just been tickling the same spots in my brain, hearing you talk about it. https://www.unison-lang.org/learn/the-big-idea/
Yes, a few of the same concepts especially using content based addresses. It's not first class in Clojure but it can become so in a place where the code has been transformed into data.
That’s it. I’m going out the playground to drink IPAs with the other parents. Have a great summer weekend everyone!
You too! 😎