Live data from Hacker News

GitHub CLI 1.0

github.blog

201–210 of 221 posts

Re: GitHub CLI 1.0

#201
post #87

Earlier quoted context omitted.

Never heard of Azure Repos before. Do they have any unique features that could be merged into Github?

When reviewing PR, it has nice file/folder tree on left side, which is far superior compared to scrolling over 10+ files without context on Github, I hope Github gets this soon...

Bitbucket has it as well. When you move from Bitbucket to Github your PR workflow in the WebUI feels utterly complicated and way harder to review. I already started to use gh a few month ago and that finally puts some sanity into working with github. Beside of creating PRs and merging them you can also get the diff of the PR, and pipe it to other tools. In the most simplistic case into diffstat. That finally compensates a bit for the horrible WebUI experience. Still a tree view would be nice.

Re: GitHub CLI 1.0

#202
post #176

Earlier quoted context omitted.

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 sh…

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)

Re: GitHub CLI 1.0

#203

Earlier quoted context omitted.

Good point. It never seemed like the distributed "selling point" of Git (and Mercurial et al) really caught on. I remember trying to extoll it's virtues to our team at the time (pre-Github). No one source of truth as such, just everyone swapping changes as needed. It's kind of ironic that Git's most popular incarnation is based upon a centralised model. Is it just a case of the distributed workflow just not being tha…

I think in practice it's most useful as a recovery feature. I once got locked out of my Bitbucket account and had to recover a repo, which I'd been paid to develop, from Heroku of all places. I was extremely grateful at that point that all git repos are complete mirrors of each other.

It is also useful that you have full access to repo when internet is unavailable.

Re: GitHub CLI 1.0

#204

Earlier quoted context omitted.

CLI or not, it's centralized/siloed all the same. I'm sticking to Git.

Good point. It never seemed like the distributed "selling point" of Git (and Mercurial et al) really caught on. I remember trying to extoll it's virtues to our team at the time (pre-Github). No one source of truth as such, just everyone swapping changes as needed. It's kind of ironic that Git's most popular incarnation is based upon a centralised model. Is it just a case of the distributed workflow just not being tha…

Distributed workflow is still plenty useful, but the master copy being hosted by GitHub doesn't really affect it all that much. The real benefit was the ability to clone a repo and just start working on it locally - with commit history, branches etc - and then tidying it up and merging it back upstream when possible and convenient.

Are people forgetting what life was like back in SVN days, when not having a connection to the server meant not being able to do many operations?

Re: GitHub CLI 1.0

#205
post #156

Great news but my first thought was that it's hard enough for juniors to grasp the difference between git and github. Now they will be even more confused... :]

To be fair, they’re not explicitly saying to alias it as `git` this time. At least with a different name the distinction is clearer

Re: GitHub CLI 1.0

#206

Earlier quoted context omitted.

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)

[deleted]

Re: GitHub CLI 1.0

#207

Earlier quoted context omitted.

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/

Re: GitHub CLI 1.0

#208

Earlier quoted context omitted.

> "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.

Re: GitHub CLI 1.0

#209

Earlier quoted context omitted.

CLI or not, it's centralized/siloed all the same. I'm sticking to Git.

It would be really nice if the other features of github could get into the decentralized model of git... I could imagine issues and PR reviews/comments all being mini-commits to some kind of parallel metadata repo under the hood for example.

Just make ForgeFed a reality, and then it won't really matter where the project is hosted. :)

https://forgefed.peers.community/

Re: GitHub CLI 1.0

#210

Earlier quoted context omitted.

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 
to create and switch branches in one command
Post reply on HN