Git Product home page Git Product logo

git-url's Introduction

git-url

This package adds two Git commands:

  • url – generates so called giturl which encodes repository fetch-URL and revision (can also hold paths to files); example giturl: gitu://ҝjȩMżEäḝЃȣϟṈӛŀї (points to master branch of this project),
  • guclone – clones given giturl, checkouts revision stored in this giturl.

In short:

  1. The giturls use 1024 unicode letters via base-1024 encoding, and also Huffman codes, to compress resulting string.
    • SMALL SIZE
  2. Thanks to using glyphs that are letters (not symbols) double clicking on giturl always selects whole string, regardless if it's done in e.g. Firefox, Chrome, iTerm2, xterm, etc.
    • CALM SELECTING
  3. git url ... and git guclone ... understand giturls also without leading gitu://, and with leading //, so grabbing and using such url is easy.
    • EASY USE
  4. You can encode path to file in the giturl, to e.g. point someone to a location in project.
    • PACKED WITH DATA

Compare length of the above example giturl to the data it stores:

ҝjȩMżEäḝЃȣϟṈӛŀї
https://github.com/zdharma/git-urlmaster

Screenshot

Screenshot

Installation

make install

Recursively clone and run make install. Default install location is /usr/local. It can be overriden by setting PREFIX, e.g. make install PREFIX=/opt.

git clone --recursive https://github.com/zdharma/git-url
cd git-url
make install

Zplugin

If you use Zshell then there's a nice way of installing – via Zplugin:

zplugin ice as"program" pick"$ZPFX/bin/git-(url|guclone)" make"install PREFIX=$ZPFX"
zplugin light zdharma/git-url

To update, execute zplugin update zdharma/git-url. $ZPFX is ~/.zplugin/polaris by default.

Extra info

The project uses two subprojects, one of them written in C++ (compiled with CMake), second one in Zshell. They are the computation backends, and any of the two will work (choose with export GITURL_TOOL=zgiturl or ...=cgiturl).

Limitations

Only a subset of ASCII is encoded. This is sufficient for typical Github usage, where user and repository name are required to not use symbols, and where typical project branch names and file names are simple ASCII. Following characters can appear in input data – in the server, repository path, user name, revision, file path: [a-zA-Z0-9._~:/-].

Encoding file paths

Use -p option to embed path to file in giturl:

% git url -p lib/common.sh
Encoding... INPUT is next paragraph:

Protocol: https
Site: github.com
Repo: zdharma/zplugin.git
Revision: master
File: lib/common.sh

gitu://ŬϽẝá0ȘéőϞȳƾDZϠѝŌěcḆΚṳȣϟṈӛŀї

Suggested is to use tilde ~ to separate multiple file paths. The project can be easily extended if this workaround will not suffice, to encode multiple file paths natively.

git-url's People

Contributors

psprint avatar pschmitt avatar vladdoster avatar

Watchers

Luong Vo avatar  avatar

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.