Showing posts with label github. Show all posts
Showing posts with label github. Show all posts

Wednesday, February 19, 2020

github and line separators

https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_formatting_and_whitespace " You can tell Git to convert CRLF to LF on commit but not the other way around by setting core.autocrlf to input:

$ git config --global core.autocrlf input "



https://www.jetbrains.com/help/idea/configuring-line-endings-and-line-separators.html this one also helps



Per-repository settings

Optionally, you can configure a .gitattributes file to manage how Git reads line endings in a specific repository. When you commit this file to a repository, it overrides the core.autocrlf setting for all repository contributors. This ensures consistent behavior for all users, regardless of their Git settings and environment.


in Intellij there is an "Inconsistent line separators inspection", to check if the files have "line terminator" different from the default setup for the project
"This inspection detects files with line separators different from the project default. E.g. you set the line separator to "\n" in the Settings|Code Style|Line separator, and the file you are editing uses '\r\n' as a line separator"





Sunday, April 29, 2018

Cool Java library to handle github

Especially useful is the Authentication API, it's really very simple.

http://github.jcabi.com/index.html

package pvgithubclient;

import com.jcabi.github.Coordinates;
import com.jcabi.github.Github;
import com.jcabi.github.Issue;
import com.jcabi.github.Repo;
import com.jcabi.github.RtGithub;

/**
 * http://github.jcabi.com/index.html
 * http://github.jcabi.com/apidocs-0.38/index.html
 *
 */
public class GitClient {
 public static void main(String[] args) throws Exception {
  Github github = new RtGithub("myusername", "mypassword");
  Repo repo = github.repos().get(new Coordinates.Simple("myusername", "myrepository"));
  Issue issue = repo.issues().create("How are you?", "Please tell me...");
     issue.comments().post("My first comment!");
 }
}



Farewall to all those horrible REST calls with hand-made JSON or even worse XML.
Yes, "FareWALL" in the sense that I hope that whoever invented REST and XML and JSON can hit a WALL with his bicycle. Proper APIs is the only way to handle everything.

Ah, beware that you cannot DELETE an issue in github, once created.... this because some MORONIC FASCIST decided so, despite public outrage. So use this example with care.





Thursday, October 19, 2017

Install GitHub locally

https://about.gitlab.com/installation/#centos-7

you can install Gitlab on Linux