Giter VIP home page Giter VIP logo

gitconfigure's Introduction

Creative Commons CC-0 v1.0 license logo (small)

gitconfigure

Portable Gitconfigure setup. Sensible aliases and Windows support. Not good enough autocompletion support yet.

Installation instructions

  1. Install Git
  2. Check out this repository somewhere
  3. Rename .gitconfig.local.new to .gitconfig.local
  4. Edit contents of .gitconfig.local to reflect your Git identity. This file is added to .gitignore so that your local details will not be a part of any subsequent changes you may want to make to your .gitconfig.
  5. Create a hardlink from .gitconfig in the local directory to .gitconfig in your home directory`.

gitconfigure's People

Contributors

pandruszkow avatar

Watchers

 avatar

gitconfigure's Issues

Installer: Add "pipe-curl-to-shell with integrity checks" install mode

Currently the script repo has to be checked out manually into the correct location, then the installer has to be run.

There should be a pipe-curl-to-shell type command to automatically checkout the repo in the right location, and then run the installer.

Lots of thought should be given to how to do this safely (see https://0x46.net/thoughts/2019/04/27/piping-curl-to-shell/) and numerous other articles. At minimum, we want to guarantee that the script arrived in its entirety and that the user can view it directly in the terminal to screen for malicious bootstrapper content. There's still the matter of malicious contents of the repo, but that's a job that you do when you have some spare time anyway.

The installer should check that the currently checked out repo commit is cryptographically signed with a relevant key.

We do not want to assume that a successful transfer == full integrity. The remote server isn't guaranteed to soft-fail without causing an error exit status on curl. Any proxies for the traffic may also MITM even HTTPS contents, and those can fail too. It might be a good idea to attach a SHA256 or a GPG key fetch in the curl command to combat that. Or perhaps a CRC check might suffice to keep the checksum short. The threat model for this installer doesn't include a successful MITM with malicious intent, since this script will be run on computers that are assumed to be free of compromised or malicious HTTPS CA certificates, so at least the HTTPS connection would guard against that.

The pitfall of this is that, unless a GPG signature is used, the checksum embedded in the command will change every time the installer is changed. This may be a smaller pain from release management POV if the initial installer itself rarely changes.

cksum may be used for this. It seems to be standard-ish across Linux distros (maybe even in POSIX or some base standard?) and gives script length as well to help with connection dropout issues.

Potential idea: write a blog article about this, and the thought process.

Edit: It might be sufficient to place the installer code inside a function (see the end of https://www.arp242.net/curl-to-sh.html), and rely on the assumption that bash will not execute it if the entire function + the entire function invocation command is not transferred across. This would get rid of any noise created by an embedded checksum and make releasing easier. GPG keys should still be verified though.

Make branch: command should always automatically set the corresponding upstream branch

This is necessary for some GUI tools. For example, IntelliJ's GitLab integration plugin can't detect which upstream branch the current local branch corresponds to, unless this is set up correctly using the Git command line (even when the branch was originally created locally and pushed to the server). This prevents it from being able to open the current file in browser.

Modernise Windows-isms

Base this on whatever the new Git for Windows installer is doing, and based on recent online guides and SO answers.

Log: refactor/fix/deduplicate all commands

They are currently a mess. Best to re-do them from scratch with a single command that has multiple modes toggled using CLI switches. Make the naming more consistent too.

Modernise command definitions

Some Git commands have likely become deprecated, or replaced with clearer new commands that I can take advantage of by rewriting definitions. This is the ticket for tracking the replacement/rewriting work.

Config file: develop version 2.0 based on a shell wrapper

The flaws of the current gitconfig-based approach are becoming more evident. It's time to replace the entry point for the aliases with a shell script. Benefits will include more detailed feedback (i. e. print what a command just did), cleaner definitions for commands that include more than one pipeline stage, more powerful abilities to override Git built-in commands, easier integration with environment variables and resources/data outside the script.

Potential question: should the installer script and the main script be one and the same?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.