Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

z-shell/cgiturl

Repository files navigation

CGITURL


Note:

  • This repository is outdated and may not work properly.
  • Please consider opening a pull request or an issue, if would like to speed up development.

What is CGiturl?

It's a tool that allows you to pack Git repository data into single URL. For example:

% cgiturl https://github.com/z-shell/giturl -r devel -p lib/coding_functions.cpp
Protocol: https
Site: github.com
Repo: z-shell/giturl
Revision: devel
File: lib/coding_functions.cpp
gitu://ŬṽǚǫoŒẗ6ẏȅcЭÑẩőn4ầŘїệαЃȣϟṈӛl·ї
% cgiturl -d gitu://ŬṽǚǫoŒẗ6ẏȅcЭÑẩőn4ầŘїệαЃȣϟṈӛl·ї
Protocol: https
Site: github.com
Repo: z-shell/giturl
Revision: devel
File: lib/coding_functions.cpp

This is C++11 implementation. There is the main Zsh implementation too. You don't have to use Zsh as your shell, just have it installed, like Ruby.

The resulting URL is highly compressed thanks to use of Huffman codes and base-1024 encoding. Compare length of the above data to the gcode in URL:

ŬṽǚǫoŒẗ6ẏȅcЭÑẩőn4ầŘїệαЃȣϟṈӛl·ї
https://github.com/z-shell/giturldevellib/coding_functions.cpp

It is 29 vs 62 characters, and you would normally need additional description like "the branch is: ", etc. Giturl allows to easily grab repository data from web page and terminal.

Limitations

Only following characters can appear in input data – in the server, repository path, revision, etc.: [a-zA-Z0-9._~:-]

Characters used in base-1024 encoding

The characters are carefully chosen so that double clicking GitURL selects the whole gcode. Asian scripts are not used because characters from them are double-width and they would consume the space saved by the compressions.

0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
μoÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáãäæçèéêëìíîïðñòóôõöøúûüýþÿĀ
āĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľ
L·l·ŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻż
ŽžsƀƁƂƃƄƅƆƇƈƉƊƋƌƍƎƏƐƑƒƓƔƖƗƘƙƚƛƜƝƞƟƠơƤƥƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽ
ƾƿǀǁǂǃǍǎǏǐǑǒǓǔǕǖǗǘǙǚǛǜǝǞǟǠǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰDZdzǴǵǷǸǹǺǻǼǽǾǿȀȁȂȃȄȅȆ
ȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȜȝȞȟȠȡȢȣȤȥȦȧȨȩȪȫȬȭȮȯȰȱȲȳȴȵȶȷȸȹȺȻȼȽȾȿɀɁɂɃɄ
ɅɆɇɈɋɌɍɎɏḀḁḂḃḄḅḆḇḈḉḊḋḌḍḎḏḐḑḒḓḔḕḖḗḘḙḚḛḜḝḞḟḠḡḢḣḤḥḦḧḨḩḪḫḬḭḮḯḰḱḲḳḴ
ḵḶḷḸḹḺḻḼḽḾḿṀṁṂṃṄṅṆṇṈṉṊṋṌṍṎṏṐṑṒṓṔṕṖṗṘṙṚṛṜṝṞṟṠṡṢṣṤṥṦṧṨṩṪṫṬṭṮṯṰṱṲ
ṳṴṵṶṷṸṹṺṻṼṽṾṿẀẁẂẃẄẅẆẇẈẉẊẋẌẍẎẏẐẑẒẓẔẕẖẗẘẙaʾṡẜẝẟẠạẢảẤấẦầẨẩẪẫẬậẮắẰằ
ẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữ
ỰựỲỳỴỵỶỷỸỹỻͻͼͽΆΈΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΫάέήίΰαβγδεζηθικλμνξοπ
ρςστυφχψϋόύώβθΥΫφπϗϘϙϚϛϜϝϞϟϠϥϧϨϩϫϬϭϮϯκρςεϷϸΣϻϼϽϾϿЀЁЂЃЄЅІЇЈЉЊЋЌ
ЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъ
ыьэюяѐёђѓєѕіїјљњћќѝўџѡѢѣѥѫѱѲѳѵѷѻѽѿҀҁҋҌҍҎҏҐґҒғҔҕҖҗҘҙҚқҜҝҞҟҡҢңҤҥ
ҩҪҫҬҭҮүҰұҲҳҵҶҷҸҹҺһӀӁӂӃӄӅӆӇӈӉӊӋӌӎӐӑӒӓӔӕӖӗӘәӚӛӜӝӞӟӠӡӢӣӤӥӦӧӨөӪӫӬӭ
ӮӯӰӱӲӳӴӵӶӷӸӹӺӻӼӽӾӿאבגדטךכלםמסעףפץצקרשװ

About

A tool that allows packing Git repository data into a single URL.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

AltStyle によって変換されたページ (->オリジナル) /