Hacker News new | ask | show | jobs
by mroll 2098 days ago
Oh wow this is great. I’ve been wanting an org mode integration with GitHub for a while, and this tool might make it easy enough for me to hack together this weekend.

Basically I want to be able to pull up a buffer with a list of issues assigned to me and copy them into my org mode todo list

2 comments

You can do this using Forge within Magit already! And it also works for Gitlab: https://magit.vc/manual/forge/
I've been using Emacs for a decade and still have never had to write a single package of my own. Every time I have a good idea, someone else has already implemented it.
Consider donating -- if you're a software engineer, acknowledge the value of your own time!
I donate little bits here and there when I can, but I'm unfortunately not in financial position to give what I think the maintainers deserve. Instead I try to submit documentation patches to projects whenever I find myself digging through the source code trying to answer a question the docs didn't make clear.
That makes you a solid contributor in my book!
I've written a few specialisms that couldn't really be open-sourced. e.g. wiring up inf-ruby and internal dev tools to open up a rails console in dev, or generate a jwt from the auth server in the cluster.

The only package I've been ultimately responsible for is the Gruvbox theme[^1], but that was very quickly handed over to other emacsers :)

I still find it a joy to write and it's one of my more preferred rabbit holes to dive into. Maybe one day there'll be something more to share :)

[^1]: https://github.com/mrleedev/emacs-gruvbox-theme

Oh wow, I used to use that theme. Thanks for making it. Yeah, most of the elisp I write is mostly just glue code, not something that makes sense to package and distribute.
Been meaning to try Forge, thanks for the reminder. Honestly, Magit alone is enough reason to use Emacs. Projectile is a close second for me.
I find projectile too chatty and distracting none thing I like about emacs is that I can focus on what I’m working on.
In what way do you find it too chatty? That hasn't been my experience, but I do use a pretty small subset of it. Are you using it on its own, or with helm/ivy?
It could have been hel or ivy I was seeing. I don’t like the mode line moving (growing the minibuffer) as I typically keep my eyes on part of the buffer and don’t want anything moving (or worse, obscuring where I’m looking)
Can you recommend any good articles or howtos on Forge and Projectile?
I switched from Emacs to VSCode but I still use Magit to do rebases.
Now this is awesome.
Forge is great. Magit is such an enjoyable plugin already, but integration with PRs and issues takes it to the next level.
Haha of course this already exists! Thanks a lot for the pointer, I will for sure start playing with it this week :)
This is awesome, but with all due respect I also wish git itself was also improved.

Goddamn merge commits, and always have to go googling "oh shit how do I erase the last commit" when I accidentally commit to master. It should at least spit out a warning if you created a branch and then try to commit to master. Git lfs and git-crypt should be a feature of the main product and not plugins. Files over a certain size should be transparently LFSed without some need to "track" them or install a plugin to fetch them. It's too hard to accidentally forget to encrypt something or LFS something. Gitignore is easy to screw up and accidentally commit a sensitive credentials file. And "git rm" also removes the file locally with no recourse -- that should not be the default behavior.

Also, the whole UX around submodules REALLY sucks ... is it git submodule update --recursive --init? git submodule init --update --recursive? git init submodule --recursive? I can't remember for the life of me. Why can't it auto-clone all submodules when you clone the parent repo, seeing as you kind of need them to do anything? The UX is so bad that I often just copy the contents of the repo instead of using submodules.

There are "hooks" in git that can be used to modify its behavior, to e.g. "spit out a warning if you created a branch and then try to commit to master"

This seems to be a good resource https://githooks.com/

> "spit out a warning if you created a branch and then try to commit to master"

How this one may be done? It sounds wonderful but I have no idea how to implement such thing (and if not included in git already, I hope that I can reuse code rather than reimplement it)

Oh, hey now. Look at the very bottom of the resource I sent you, under "Snippets" https://githooks.com/
"A pre-push hook that prevents direct code push to master branch"

and I would want

"spit out a warning if you created a branch and then try to commit to master"

Sometimes I would want to commit to master, I want an overridable warning iff I just created branch.

How about

  #!/bin/sh
  BRANCHES_POINTING_TO_HEAD=$(git branch --contains HEAD  |wc -l)
  CURRENT_BRANCH=$(git branch --show-current)
  if [ "$BRANCHES_POINTING_TO_HEAD" -gt 1 ]; then
    if [ "$CURRENT_BRANCH" = "master" ]; then
      echo "You're committing to master even though other branches exist."
      echo "override with git commit  --no-verify"
      exit 1
    fi
  fi

You'll need git 2.22 for the --show-current git option.

But also I would suggest instead using

  git checkout -b <new_branch>
to create and switch branches in one command