How make github to ignore whitespaces/newlines - github

I'm running a team of developers on a project and I constantly see this kind of commits:
Whenever I get about 5000 lines of code like this, i get quite frustrated
Is there any way to make github not show added whitespaces/newlines?

Set the URL parameter w=1 in the github url which enables the ignore whitepsace feature
Take a look at the difference between
https://github.com/renelink/..../9491a0ed3ae57f7b33386605d3f62f85eca8ae05
and
https://github.com/renelink/..../9491a0ed3ae57f7b33386605d3f62f85eca8ae05?w=1
But I guess the main problem is that the developers work on different OS and do not configure core.autocrlf.

Related

Use versions w/ github remote repositories (in this case w/ platformio)

This might be a basic github question, but I'm having trouble finding the right keywords to google because I don't know the terminology. Apologies and thanks in advance.
I've noticed with library dependencies in library.json, under "dependencies", there is often a github remote repo link with a version number after the #
For example
https://github.com/codewitch-honey-crisis/htcw_ili9341.git#1.0.0"
What is that exactly after the #? A branch? A release?
More importantly, how do I make my github repo expose these. Like, I want to make a 1.0.0 one now for htcw_ili9341.git but later I may want to make 1.0.1
Using the github website, and/or the command line, how do I go about this?
It would be really helpful if you explained as you went as well.
So you know where I'm coming from with this, I've been using github for awhile but only for the most basic things, and driving it all through VS Code for the most part, sometimes resorting to the web interface and only occasionally dropping to the command line, which I've done a handful of times to resolve merge conflicts. I'm not an expert, but not completely new to it either.
anything after # is never posted to the server. It's basically a comment in this specific instance.

Create new branch from the Issue

Is it possible to create new branch directly from Issue which is posted on Github? We have project hosted on Github with many issues, it would be easy for us just to click one button in Issue web interface and create new branch for it to start developing.
This is not possible directly from the issue interface. I can try to provide you some workarounds and maybe start a debate why one would want this feature:
Creating branches directly on the web interface
After you've noticed that you need to start working on an issue you can just go to the repository main page (keyboard shortcut gc) and create a branch with the name you want:
Chrome extensions
If this is a must for you, you can create a chrome extension that augments the UI and creates a branch directly from the Issues WebUI using the GitHub API. There's a lot of open source extensions that augment the default WebUI.
Is it the most efficient way to start a new feature?
I think this changes from developer to developer, but having worked with GitHub for 7 years using Issues I've never felt the need for this feature because unless it's a one line change that doesn't require local testing or compilation, I still want to get down to my command line and IDE. If I have to do that, I still have to at least git fetch to get the branch I just created directly through the issue interface. If that's the case I've always preferred to just look at the issue and run git checkout -b branch-name, optionally with git push if my team needs to see the branch.
Then the issue name wouldn't normally translate to a branch name, at least I wouldn't want that. So that option to create a branch from an issue would probably need to spin out a prompt to allow me to name the branch what I wanted.
This is just my personal opinion and nothing else, hope it helps :)
GitHub finally added this feature request to their roadmap.
Summary
The branch is the first thing a developer creates when the start
working on a new issue. Creating that association makes it really easy
for someone to then follow the work happening and keep everything
connected as they take their idea to code.
Intended Outcome
We want to help developers get started on work faster and signal to
their team where to find the code changes related to an issue. It
should also be really easy to then follow development to the pull
request without the user needing to do additional work to link
everything together.
How will it work?
From the issue page, a user can quickly create a branch with an
auto-generated or custom name that becomes associated with the issue.
They can then fetch the branch and switch to it in their development
environment and further development changes (such as commits and pull
requests) are automatically associated with the issue.
https://github.com/isaacs/github/issues/1125
Nope. You can subscribe this issue.
You could accomplish this by creating a small script.
I'd start by leveraging the Issues Event webhook. This will fire a JSON payload every time an issue is opened. When the webhook fires, your script can then create a new branch using the Create a Reference API endpoint. Note: URL must be formatted as heads/branch, not just branch.
There is an app that automatically creates branches for issues. You can install it here for free: https://github.com/marketplace/actions/create-issue-branch
If you want to create the branches manually instead of automatically:
It does not enable you (directly) to click on create branch from the issue. Instead you would have to write a comment in the issue consisting of: /cib. If you do that, it automatically creates the branch from the issue.
Please note I have no affiliation with the app.
Recently I saw that Github finally added this feature to its Issues Panel.
All you have to do is navigate to an Issue on Github and scroll down to the following section:

Spacing characters during Pull Request code review

So I am using github pull requests for my code review needs and my only issue is that I cannot tell whether a person is using tabs or spaces for indentation. We have a standard here on this and you can fail code review for using the wrong one. Is there a way to tell which they are using with github or will I have to manually open up the file in my editor to tell the difference?
Is there a way to tell which they are using with github or will I have to manually open up the file in my editor to tell the difference?
Ideally – neither!
Whenever things can be checked in an automated way, let the computer do the work for you. Checking proper usage of whitespace among many other static rules can be checked with a variety of tools, often called linters. This highly depends on what language your project uses. Of course you can also write your own scrips if you so choose.
What you can do on Github is connect your repository to a CI tool such as Travis. This lets you automatically build all pull requests and check things such as whitespace rules. It also lets you run test suites, code formatting, … – anything you can automate, you can (and should!) run from there to minimize manual work.

How to prevent git pull request if JSLint fails

I am working on a large project with a number of other developers.
We have implement JSHint which will throw an error when grunt build is run if the JavaScript does not pass the Lint.
I would like to know if it is possible to integrate directly with Github so that a Pull Request will not be allowed to be merged unless it passes in JSHint.
Is there a way or tool to do this?
You can't prevent pull requests from being merged; however, you can automatically run JSLint using Travis-CI, which will put a big red X on pull requests that do not pass JSLint. Hopefully this is enough to stop people from merging these pull requests.
This blog post gives a good introduction to running grunt tasks on Travis-CI.
There is a free way to do it too by lint-review
As #tbekolay said, it puts a red sign.
Also, you will see the problems as comments on the code wich is super cool.
But you can merge it manually.

GitHub for Windows - Not Getting Any Project Files, Freezes

I try to clone a repository from github, and every time, it makes the folder with the project name, it makes the .git folder, and then nothing happens, it just freezes.
Running Windows 7 32-bit
I can download a zip using https, but I want to use git.
I've set up git globals and so on. I suspect it may be an authentication problem, but I have no way of knowing. Does anyone have any ideas?
"Freezes" sounds definitely like a bug.
Indeed, keeping the UI responsive was one of the first design goal of GitHub for Windows (We've mashed up the elegant Caliburn.Micro with ReactiveUI to provide a responsive interface and to allow for greater testability.)
Short version:
send an email to support#github.com
Long version:
As stated by the GitHub for Windows launch blog post:
If you find a bug, submit it to support#github.com. Every email is read by a real person
More recently, xpaulbettsx, a GitHubber, even tweeted about this :
Support# is good for Anything you want to tell GitHub - bugs, features, high 5s; everything but security which go to security#