820 points · by c8g · 9y ago · 305 comments
There are SO many times I need a short peek at something, and am glad don't have to clone/download, etc.
The source browsing feels barely adequate to me. There are so many simple things they could do to make it better.
• Show file sizes. When I'm exploring a repo I'm unfamiliar with, one thing that's helpful for me is to get a sense of what the code is like. To do this, I want to look at some of the larger files; that's where I'll probably find the more interesting code. As it is I just click around on random files hoping to find something interesting.
• Show real dates instead of the vaguely rounded off "how long ago". If it says "a month ago", well, what is it, two weeks or six? And why not show the time? A couple of times I've been looking for a code change and I didn't remember what day it was but I did remember it was right before lunch, maybe around 11:30 or so. It feels like their priority is a "clean and simple" display as opposed to a useful and informative display.
• Fix the display for code that indents with tabs. It still defaults to 8 columns, which hardly anyone (with a few notable exceptions) likes. And you, the user, can't override this. They did recently start honoring the indent_size setting if you have a .editorconfig file, but that really misses the point. Many of us who use tabs don't want to specify an indent_size. That's one of the virtues of tabs: people who read the code can use whatever indentation they prefer. The indent size for tabs should be a user preference setting. As it is, I started adding indent_size=4 to my .editorconfig files just to get a decent looking display on GitHub.
• Use a readable font on mobile. Courier, really? And not such low contrast! Everything is hard to read on mobile, and they even disabled pinch-zoom so I can't make the text a little bigger.
• Show a directory tree on the left. If I'm exploring a repo, I'd like to get the big picture of the directory layout, and also have an easy way to click around to look at the various directories. As it is, I have to do a lot of back and forth. Google Code had this from the beginning.
Edit: Thank you everyone for the helpful replies! I learned some great tips from you all.
Those are at the top of the display of file contents. However, they aren't in the tree view, as you've stated. Unfortunately, this is hard because I don't believe Git stores this info in their index of files, which is what is used to generate the tree view. It might be infeasible to gather that data for the tree view.
> Show real dates instead of the vaguely rounded off "how long ago".
If you hover over any relative date, the real date is shown. It's on the title attribute for any relative date.
> Use a readable font on mobile.
The have Consolas and "Liberation Mono" on the font stack, but those probably aren't on your phone. They are limited in font selection because they have switched to native fonts. This avoids the download of some giant font file that contains all the possible glyphs (which is needed on a site like GitHub's). Unfortunately, the monospace options on mobile are pretty limited: http://iosfonts.com/
> Show a directory tree on the left.
Best tip I can offer is to type `t` to search by file name. Works great and has partial matching support, which makes it really quick to navigate to certain key files.
>>> import zlib
>>> f = open('.git/objects/00/331d4c2e12984f70df4a3dd3bc7296825faab0', 'rb')
>>> zlib.decompressobj().decompress(f.read(100))
b'blob 11708\x00...'
So that particular file is 11708 bytes. It still requires an open and read operation. But they could cache that on a per-file or per-tree basis, so it's very doable.What i found:
t = search file
j/k = move down/down (selected file)
w = select branch
s = focus search field
y = expands url
Anyone know any more?
EDIT: Found this https://help.github.com/articles/using-keyboard-shortcuts/
I don't know if they keep a work tree on the server side, but if they did, then it would be trivial to store the file size as determined from the file on disk and display it on the front-end regardless of the type of view. Alternatively, they could determine the size from the blob associated with the file in the object store.
FYI there's a Chrome extension for that
https://chrome.google.com/webstore/detail/octotree/bkhaagjah...
I still think GH's insistence on 8-space tabs is part of a secret conspiracy campaign to get people to stop using tabs. It always looks bad when you look at tabbed source code in there, so the easier way to avoid it is to start using spaces instead.
Hidden feature: you can actually add ?ts=2 (or 4) to the URL. It would be nice to be able to configure it, though.
https://userstyles.org/styles/70979/github-better-sized-tabs...
Can anyone explain to me why this is even a feature?
Why did the powers that be decide that web sites should be able to prevent pinch zooming? Why do mobile browsers not provide the option to disable this bug?
In Firefox, you can set browser.ui.zoom.force-user-scalable to true.
Unfortunately, if have JavaScript enabled, some pages are still able to disable the zoom.
The OctoTree extension is great for this (all browsers, and works for both Github and Gitlab)
Features
1. Displays repo size.
2. Displays each file size in every active branch (not applicable for folder / symlink).
3. Show download link for each individual file (not applicable for folder / symlink).
4. Copy file's contents directly to Clipboard (just won't work for markdown files).
5. Download file while viewing it's contents.
[1] https://github.com/softvar/github-plus
[2] https://chrome.google.com/webstore/detail/github-plus/anlikc...
God made the ASR-33 with 8-column tabs for a reason. ;-)
As for style, it is relatively easy to make a browser plugin that overrides the default styles of a site. While working for Canonical, I did one for Launchpad:
https://chrome.google.com/webstore/detail/launchpad-tweaks/p...
if you use Chrome, try out Octotree
Plus decent rendering of README.md at the same base URL.
You get a decent homepage for your project by just pushing your repo.
I wish GitLab just copied the base project page of GitHub.
I love the idea of gitlab but I absolutely cannot enjoy the UI. I have trouble understanding the layout of the project from the base URL. I don't have that problem at all on github.
Edit: I'm a fool. I swapped gitlab and bitbucket. BB interface is absolutely bad to me.
Also, the search documentation is spread out and seems to be missing guidance on features that are crucial. For example, AND works as you would expect (like: hello AND world), but it isn't mentioned anywhere.
No online service in the world does not index things.
If you need full access to everything, why not just clone the repo and do these things in the comfort of your command line?
foo AND bar NOT baz OR fizz
So, it supports AND, NOT, and OR. Nowhere, though, does it say that. I don't know if I can group these to get around precedence either. Parenthesis are ignored. It does mention NOT somewhere. And, there's no navigation to search help by the search button. I had to google to find out any help was available.
Also, it ignores some characters for unknown reasons. Like $, for example. That's a meaningful sigil in Perl, PHP, and so on...it's quite frustrating that it's ignored.
(Disclaimer: I'm one of the creators. We currently only support Go officially, but other languages soon on the way via the open-source Language Server Protocol standard. Also, big fans of GitHub and glad to see this move!)
I am guilty of occasionally even viewing my own projects on github to avoid having to put down what I'm doing to check what's in production...
As far as I can tell, Gitlab (still) doesn't have search within repo. It's one of the most useful features on Github for me; often I want to see the definition or uses of some symbol without having to clone the repo. I don't understand why Gitlab doesn't seem to support it.
Damn... I can't even manage to figure out how it works. I consider myself extremely lucky when it returns the expected result, and that seldom happens.
What I like in github .. it's a multiformat http file viewer.
I quite like the idea of "centralizing" development on GitHub, or similar services. It makes it much easier for everyone to fork, test, make a pull request, merge, etc..
For example, one reason why I gave up contributing to OpenWrt was their absolutely legacy contribution system [1], which required devs to submit code diff patches via email (good luck not messing up the formatting with a modern client) on a mailing list. It took me an hour to submit a patch for three lines of code. It seems like Python wasn't much different. [2]
[1] https://dev.openwrt.org/wiki/SubmittingPatches#a1.Creatingap...
Git is distributed, so when GitHub goes down, every developer has a backup of entire history. However, issues are lost forever. Python does not use "issues" feature for good.
One way to avoid email without centralization is setting up Gerrit. That is how Ring [1] and LineageOS (former CyanogenMod) [2] manage their "pull requests".
Still, being able to submit patches via email is an absolutely necessary skill for everyone who considers himself a hacker. Lack of it makes you unable to contribute to many great projects, such as all suckless [3] projects and Linux itself.
[1] https://gerrit-ring.savoirfairelinux.com/
Until I got a job working as a kernel developer I had never had to use emailed patches. It simply isn't an "absolutely necessary" skill for a good developer these days.
The kernel community is too attached to email patch submission for it to ever move away, and to be fair, email does have the benefit of being scalable and matches our decentralised workflow much better than any of the current alternatives.
But it's still not good. There are plenty of ways to screw up email threading or forget conventions on labelling patchset versions or whatever (this happens all the time). You have to rely on external tools such as Patchwork to provide a bare minimum of state-tracking. There's not much by way of generic CI tooling that's designed with email in mind (I'm working on this!). Doing code review from an email client definitely has its benefits, but it's also limiting - web-based code review tools have much more scope for experimenting with better ways of presenting comments.
I can't see the Linux kernel ever moving away from email, and honestly it's not too bad once you've figured out your workflow, but I would like to see kernel hackers thinking about what it is that the kernel community loves so much about email compared to GitHub and other centralised services. It is disappointing to see other large open source projects becoming incredibly dependent on a for-profit proprietary software company that may well not survive the next few years. How can we do proper decentralised version control and development better?
When you end up using it for a long time, going back to pull requests is awful.
Its basic things:
- history of a PR - I cannot see the diff of last version of the patch and latest
- dependant changes - I need to do some work that depends on a patch someone else is working on. This can't be done in github.
- clean history - no "added tests", "fixed docs typo" etc commits
I learnt recently that most people don't use git-review[0] - and yeah, if you are manually doing the "git push gerrit ref/for/master" crap, it's really annoying. but git review and repo were written to help that.
Ooh, interesting. Where can I find out more?
BTW, you might consider supporting NNTP as well, among other advantages, crappy email clients can't screw up the threading & you avoid Reply-To munging debates.
I am interested in learning more about this. Can you share some details? Is there a prototype?
Maybe it's a matter of configuration?
Everyone I know who has had to use github has utterly despised it. I work with a lot of systems and kernel programmers that use gerrit or email workflows.
See how anecdotes aren't very useful?
The discoverability, browsability, and useability of something with actual markup and design is infinitely better then e-mail.
I've tried several times to make submissions to several e-mail based projects, never with any success. At the same time, I've had zero issues contributing to a dozen or so github hosted projects.
E-mail systems are a shitshow. First, you generally have to join a mailing list, which is regularly broken, or requires someone somewhere to manually acknowledge your membership. Then, you have to figure out how they want shit formatted, figure out how to generate a diff (I've been using SVN for 8+ years, git for ~3 years, and have never had to deal with diff files!), send an e-mail, find the mailing list shat itself and troubleshoot, try again, etc....
Basically, e-mail is the death of any sort of low-effort contribution. If you're starting a new project, and chose a mailing list, you're probably excluding a huge quantity of potential contributors.
If there's a project where I want to make a few-line change or minor enhancement, and it's on github, I'll generally PR it back into the original. If it's somewhere else, or requires another account, there's no way I'm going to spend the effort.
Plus, just reading mailing lists is a fucking disaster. Literally no mailing list host I know of lets you just view a complete topic thread in simple chronological order on ONE PAGE. They all operate on a per-message response-tree structure, so just reading the discussion is a huge pain in the ass.
E-mail is basically dying among younger people, including the ones that code, and with good reason. For actual forum-type discussions, it's a completely shit solution.
$ git send-email --to=<mailing list> <commit range to send>
That was hard.
> First, you generally have to join a mailing list, which is regularly broken, or requires someone somewhere to manually acknowledge your membership.
Most public MLs that accept patches are Cc'd for posterity's sake, and thus generally don't require being a member to post. You will always get Cc'd to discussions (git send-email automatically adds you to the Cc list).
> Then, you have to figure out how they want shit formatted, figure out how to generate a diff [...], send an e-mail, find the mailing list shat itself and troubleshoot, try again, etc....
See above. It's one command, or two (git format-patch + send-email) if you want to tweak the email.
> (I've been using SVN for 8+ years, git for ~3 years, and have never had to deal with diff files!)
I find this hard to believe. You've never hand-edited a diff file with `git add -p` or `git checkout -p` -- or even done a `git diff`, `git show` or `git log -p`? I did all of the above things just today, let alone in the past three years...
> If it's somewhere else, or requires another account, there's no way I'm going to spend the effort.
I'm going to be honest, as someone who maintains a project hosted on GitHub I don't like it when someone decides they'll "help out" by dropping three lines of code in a patch and disappearing off the face of the earth. If you're not bothered to follow up on your patch review, then you've just inflicted a net negative on the project.
> Literally no mailing list host I know of lets you just view a complete topic thread in simple chronological order on ONE PAGE.
But chronological order isn't what you want for ML threads. You want to read it as a tree, because that's how people use email... Patch review isn't like a YouTube comment thread.
Email is ancient, web is bloated.
You can usually just send your patch to mailing list without joining at all and you will be replied off the list.
> Then, you have to figure out how they want shit formatted, figure out how to generate a diff (I've been using SVN for 8+ years, git for ~3 years, and have never had to deal with diff files!)
Unbelievable. The only explanation I can find is that you avoided dealing with diffs and used SVN only on your workplace.
> Plus, just reading mailing lists is a fucking disaster. Literally no mailing list host I know of lets you just view a complete topic thread in simple chronological order on ONE PAGE.
Mailing lists are supposed to be read in your email client. If you want an archive, use NNTP archive like gmane.
While I agree it's a good skill, this statement implies that anyone who doesn't use it it somehow arbitrarily "less important" than someone who does, when it comes to contributing to open source.
The guy in charge of making the decision weighed the fact that it's closed source, and it still won.
> But to me, the development process is more important than worrying whether a cloud-based service publishes its source code... This is especially not a worry as GitHub is not a walled garden; its extensive SDK allows for downloading any and all data that goes into the platform.
In summary, his reasons were: github has become a social network of open source devs; gitlab has no killer features github doesn't; and Guido prefers github
https://snarky.ca/the-history-behind-the-decision-to-move-py...
My personal feeing on the matter is that proprietary software can harness a lot of talent and usually delivers a better end user experience. For example, the creator of Twitter Bootstrap works for github full time. How else will you get talented people thinking about how to make a product better all day?
But GitHub issues can be exported pretty easily. Exported and saved in the distributed Git repository even.
I think relying on a platform is perfectly fine if you have an exit strategy. I've moved my blog through multiple platforms. I even maintain the domain so old URLs continue to work. Will Medium shut down? Yes. And when it does I'll move my blog again. It won't be the first time and it won't be the last.
What? That sounds like a problem with the projects, not the people. Why make it so much harder to get contributions?
Interesting, I didn't even know you could disable 'Issues' for a Github repo. Why do I come across so many projects where the dev lets random issues pile up which they clearly have no intention of responding to, then?
um, no? PEP-512 ( https://www.python.org/dev/peps/pep-0512/ ) is pretty clear about it:
"The code review history does not have the same implicit backup mechanism as the repository itself. That means a daily backup of code review history should be done so that it is not lost in case of any issues with GitHub."
good luck not messing up the formatting with a modern client
$ git send-email
GitHub is easier to get started with but both methods have their benefits. I personally prefer GitHub but don't have problems contributing to projects that use the emailed patch model.
Ah, thanks. If I only had known! :)
Maybe someone at OpenWrt (with edit access to the Wiki and such) could write a simple script for git send-email with a wrapper for the [PATCH] [architecture] what subject and Signed-off-by thing. Would speed things up quite a bit imho, especially for newcomers. I see quite a few "not formatted properly" rejections.
If you don't want to setup your client properly and keep using some GUI or Web client, you can format your patch with "git format-patch" and submit whatever files it produces.
OpenWrt rightfully expects you to read at least "man giteveryday", which is titled "A useful minimum set of commands for Everyday Git" and includes "format-patch" and "send-email" in "INDIVIDUAL DEVELOPER (PARTICIPANT)" section.
Which part of this needs to be better scripted?
I have my private projects on GitLab because it's free. (BitBucket before that; good riddance)
I say that as a someone who uses gitlab for all of my personal projects.
I've pretty much given up hope that any of these *-wrt devs take security or dev seriously.
I wonder how 'modern' a client can be if it can't even post source code properly.
https://snarky.ca/the-history-behind-the-decision-to-move-py...
> Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
Rather than just
> Copyright (c) 2001-2017
I prefer ranges personally. Also, I believe only the year of first publication is technically required anyway.
Surely adding later years must have the effect of pushing the copyright expiration date?
;)
IANAL, TINLA
It's especially sad because Mercurial is just now starting to be incredibly powerful with evolutions.
I guess I'm an old fart but all the centralization has made me paranoid and I still absolutely prefer Mercurial (albeit with plugins) over git.
Going to git is about gaining developer mindshare. There are more people using git now. So being on git will bring in more "drive by pr's". I know for my part, life is too short to keep current on multiple source code control tools. I've done plenty in my time, but git is where I'm at now. I use git now at work, and until now, all of the hobby projects that interested me except for 1, were on git. Now all are on git.
At PyCon 2016 Guido told the story of how Mercurial was selected over git. It seemed like an even match at the time. Guido is very source-code-control-tool-agnostic. But git is the current best path to enabling more people to help with cpython development.
While not being Mercurial is one thing it is really more about being on GitHub that is the problem. Kings will get complacent (remember how long it took to GitHub to add some features).
I also vaguely remember the github guys trashing Mercurial with arguabley a propaganda campaign (something "git is better than X"). All that content is missing now but I do remember (I'll have to look on way back machine later).
For people to work on Python they now have to share information with github which they may not want (they have to create an account and are probably tracked).
Git itself is decentralized. Some of github tools are centralized, but that has both advantages and disadvantages, and I and a lot of others feel the advantages outweight the latter.
The mercurial team prioritized end-user features, like evolve, over moving to Python 3, which would only affect a very small number of mercurial users (mostly devs).
I've personally moved to Python 3 for most development and not once have I encountered a case where I couldn't do something in mercurial that would have been possible if the core code was on python 3.
Python community is full of cool and nice people. I guess I expected more from them.
But it would be nice if these critical projects created gitlab or bitbucket mirrors.
Is this not the case with other hosts? If Gitlab got a DMCA notice, would they not be forced to comply? I don't think this is a good argument against Github.
But it's probably too hard to switch and core developers don't see point in it (since they're totally ok with working their way). Maybe when a new generation developers will take core positions...
I'm still dreaming of a decentralized GitHub based on something like ipfs.
Decentralized GitHub is a nice idea. We gotta implement this)
https://snarky.ca/the-history-behind-the-decision-to-move-py...
Guido's last commit, in both the github repo and the mercurial repo.
https://github.com/python/cpython/commit/934aba66ef09e94422b...
https://hg.python.org/cpython/rev/3db1959c2c53
Someone sensible may be able to shed some light on it. Presumably there's a bridge between the two somewhere.
Other than that, this is a welcome change.
Maybe he had kids. :P
what exactly was Python using before/where was it hosted? all I can find are the source archives on python.org. I'm assuming this wasn't a hard transition but I'm genuinely curious as to their development strategy regarding distribution of source.
> Basically, e-mail is the death of any sort of low-effort contribution. If you're starting a new project, and chose a mailing list, you're probably excluding a huge quantity of potential contributors.
If those contributors are as incompetent to not be able to mail a patch, I'd rather be happy to have excluded them.
That crosses into personal attack and incivility, which breaks the HN guidelines regardless of how wrong someone else is. Please don't post like this here.
We detached this subthread from https://news.ycombinator.com/item?id=13631069 and marked it off-topic.
I write python and some C++ stuff for fun in my free time. If your project interests me, but I have to spend said free time to learn esoteric tools to interact with it that aren't needed elsewhere in my life, how do you figure that's valid?
It's not that I couldn't learn to deal with that kind of shit, it's that I don't see why I should bother. If everything else works without e-mailed diffs, all that does is make anyone with more then one hobby project do is look elsewhere.
Some skills only serve one purpose. Like shaving. I learnt how to shave when I was a teen, and that skill has only been useful to me in shaving my face, since ten years. And being able to use email and diffs is a transferable skill.
I won't respond to you anymore, as I dislike your language and your contributions are trollish.
I despise this "I'm happy to exclude people too incompetent to do X" attitude. I often mentor people into FOSS. They start off pretty incompetent with the tooling. With a bit of nudging they end up making high quality contributions. A person's usage of email has no bearing on their, say, Python skills. Nor does a person's usage of GitHub. These are tools to get the job done, they are not the job themselves. Tools should be easy to use. Github isn't exactly easy, but it's much easier than patch MLs.
From a maintainer POV this is honestly perfectly fair - we have tooling like Patchwork that depends on patches being submitted inline. From a first-time contributor POV, this just puts the barrier to entry up even higher. :(
When I spent 15 hours writing a high quality patch for free, I don't want to spend 5 hours more just to send it. I have a life.
I get that you can like vim and emacs better, and it's perfectly alright. But don't pretend it's more efficient. There are very few people (I meet one maybe each year) actually efficient with them because they are tools putting the burden of many tasks (reminding states, doing transitions, making very specific selections) on the user instead of the machine.
I was therefore unable to connect to github.com, as there is no IPv6 support available:
% host github.com github.com has address 192.30.253.112 github.com has address 192.30.253.113