Comment

Comment by arp242

"gh pr" runs several git commands (5 to be exact):

  % gh pr checkout 132
  RUN: git fetch origin refs/pull/132/head:joris_tests_20230119
  From github.com:BurntSushi/toml-test
   * [new ref]         refs/pull/132/head -> joris_tests_20230119
  RUN: git checkout joris_tests_20230119
  Switched to branch 'joris_tests_20230119'
  RUN: git config branch.joris_tests_20230119.remote origin
  RUN: git config branch.joris_tests_20230119.pushRemote origin
  RUN: git config branch.joris_tests_20230119.merge refs/pull/132/head
It just so happens that my local "gh" build prints this as I was debugging a problem some months ago and I never bothered building it again without this on account of being a lazy git.

The entire reason I have "gh" on my system is to easily check out PRs and to set them up so I can push to them with a minimum of mucking about. I use it for noting else.

I do agree it would be nicer to also add the git commands (plural!), but I suspect they just didn't because it's multiple commands to get the same experience. That is: UI reasons, not anything sinister.

> proprietary "gh cli"

It's not "proprietary": https://github.com/cli/cli/blob/trunk/LICENSE

And as you can see in the output above, it's just a wrapper around some git commands. If you want to call this "proprietary" then you should also call tig, got, and other alternative interfaces to git "proprietary".

parent arp242 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton