GitUI तकनीक से जुड़ी खबरें
(github.com/extrawurst)- GitUI एक ऐसा tool है जो terminal के अंदर Git GUI जैसी usability और सुविधा देता है। इसकी शुरुआत ऐसे use case से हुई जहां बड़े repositories में मौजूदा Git GUI रुक जाते थे या धीमे पड़ जाते थे
- मुख्य features में keyboard-only operation, context-based help, changes की जांच·commit·amend, file·hunk·line स्तर पर stage/unstage/revert/reset, stash, push/fetch, branch management, commit log search और diff देखना शामिल है
- Linux Git repository के 9 लाख से अधिक commits को parse करने वाली तुलना में
gituiने 24 सेकंड और 0.17GB memory दर्ज की, जबकिlazygitने 57 सेकंड·2.6GB औरtigने 4 मिनट 20 सेकंड·1.3GB दर्ज किया - 1.0 से पहले के लक्ष्यों में log tab में branch structure visualization और interactive rebase शामिल हैं, और git-lfs, sparse repo, HTTPS के लिए
credential.helperकी automatic handling में ज्ञात limitations हैं - फिलहाल यह Git shell को पूरी तरह replace नहीं करता; यह stash या line·hunk स्तर की staging जैसे Git shell में असुविधाजनक कामों को पूरा करने के लिए साथ में इस्तेमाल होने वाला tool अधिक है
Git GUI अनुभव को terminal में लाने वाला tool
- GitUI terminal में Git GUI का user experience और सुविधा देने वाला open-source tool है
- इसे बनाने की प्रेरणा उस अनुभव से आई कि terminal में ज्यादातर Git काम करते हुए भी index, commit, diff, stash, blame, log जैसे कामों के लिए Git GUI अक्सर इस्तेमाल करना पड़ता था
- मौजूदा लोकप्रिय Git GUI में बड़े repositories पर fail होने, responsive न रहने और unusable हो जाने की समस्या थी
- GitUI का लक्ष्य terminal के अंदर portable, fast, free, opensource Git GUI अनुभव देना है
Feature scope
- Operation model keyboard-only control और context-based help पर केंद्रित है, और इसे इस तरह design किया गया है कि बहुत सारे shortcuts याद रखने की जरूरत न पड़े
- Changes से जुड़े कामों में ये शामिल हैं
- changes inspect, commit, amend
pre-commit,commit-msg,post-commit,prepare-commit-msghooks सहित- file, hunk, line स्तर पर stage, unstage, revert, reset
- Repository flow से जुड़े काम भी support हैं
- stash save, pop, apply, drop, inspect
- remote पर push, remote से fetch
- branch create, rename, delete, checkout, remotes देखना
- commit log navigation और search, committed changes का diff देखना
- UI और internal behavior में responsive terminal UI, smooth operation के लिए asynchronous Git API, submodule support शामिल हैं
- GPG commit signing support है, लेकिन #97 से जुड़ी constraints हैं
Benchmark results
- RustBerlin meetup presentation में
lazygit,tig,gituiकी तुलना पूरे Linux Git repository को parse करके की गई- target repository में 9 लाख से अधिक commits शामिल हैं
- presentation material RustBerlin meetup presentation और slides से link है
- तुलना के नतीजे इस प्रकार हैं
gitui: 24 सेकंड, 0.17GB memory, 10MB binary, कोई freeze नहीं, कोई crash नहींlazygit: 57 सेकंड, 2.6GB memory, 25MB binary, freeze होता है, crash कभी-कभी होता हैtig: 4 मिनट 20 सेकंड, 1.3GB memory, 0.6MB binary, freeze कभी-कभी होता है, crash नहीं
- इस तुलना में
gituiने time और memory categories में सबसे कम values दर्ज कीं
1.0 से पहले का roadmap और ज्ञात limitations
- 1.0 कहे जाने से पहले दो top-level goals हैं
- मौजूदा limitations में ये शामिल हैं
- GitUI फिलहाल Git shell को पूरी तरह replace नहीं करता, और दोनों tools को साथ में इस्तेमाल करने का तरीका ज्यादा उपयुक्त है
- Priority उन features पर है जो Git shell में असुविधाजनक हैं, जैसे stash और line·hunk स्तर की staging
- Project अभी spare time project है, और GitUI को one stop solution बनाने के लिए मदद की जरूरत है
Installation और build
- GitUI beta state में है और bugs व missing features हो सकते हैं
- personal use के लिए यह reasonably stable है, और GitUI के अपने development में भी इस्तेमाल हो रहा है
- इसे कई package managers से install किया जा सकता है
- Arch Linux:
pacman -S gitui - Fedora:
sudo dnf install gitui - openSUSE:
sudo zypper install gitui - Homebrew:
brew install gitui - MacPorts:
port install gitui - Winget:
winget install gitui - Scoop:
scoop install gitui - Chocolatey:
choco install gitui - Mise:
mise use -g gitui@latest - Termux:
pkg install gitui - Anaconda:
conda install -c conda-forge gitui
- Arch Linux:
- Release binaries Linux, macOS, Windows के लिए उपलब्ध हैं
- Linux के लिए x86_64, aarch64, arm, armv7 packages हैं
- macOS के लिए arm64 और Intel x86 packages हैं
- Windows के लिए 64bit single binary और 64bit MSI installer package है
- Build requirements इस प्रकार हैं
- minimum supported
rust/cargoversion 1.88 है - OpenSSL dependency build करने के लिए perl 5.12 या उससे ऊपर और C compiler जरूरी है
- पूरा test suite चलाने के लिए
pythonके रूप में callable Python जरूरी है
- minimum supported
- Cargo से
cargo install gitui --lockedcommand के जरिए build और installation शुरू किया जा सकता है trace-libgitCargo featurelibgit2tracing को enable करता है, और तब काम करता है जबlibgit2-DENABLE_TRACE=ONके साथ build किया गया हो- यह feature default रूप से enabled है, और disable करने के लिए
cargo install --no-default-featuresका उपयोग करें
Settings, diagnostics, customization
- Logging
gitui -lसे enable की जाती है - Log file location platform के अनुसार अलग है
- macOS:
$HOME/Library/Caches/gitui/gitui.log - Linux with
XDG:$XDG_CACHE_HOME/gitui/gitui.log - Linux:
$HOME/.cache/gitui/gitui.log - Windows:
%LOCALAPPDATA%/gitui/gitui.log
- macOS:
- GitUI को light और dark terminal themes दोनों में automatically काम करना चाहिए
- Color theme को
THEMES.mdके अनुसार मनचाहे तरीके से customize किया जा सकता है - Key bindings को
KEY_CONFIG.mdके अनुसार customize किया जा सकता है, औरvimstyle bindings के रूप में set किया जा सकता है - inspiration के तौर पर बताए गए projects हैं lazygit, tig, GitUp, git-brunch
- GitUp के बारे में यह लक्ष्य भी जोड़ा गया है कि terminal tool में map view इस्तेमाल करने का तरीका मिल जाए तो अच्छा होगा
1 टिप्पणियां
Hacker News की राय
इंस्टॉल करते ही xterm विंडो बहुत छोटी थी, इसलिए उसे बड़ा किया, और फ़ाइल ट्री एरिया के किनारे को drag करके छोटा करने की कोशिश की, लेकिन यह संभव नहीं था
मैं diff को बड़ा देखना चाहता था और फ़ाइल नाम भी छोटे थे, इसलिए ट्री एरिया का ज़्यादातर हिस्सा बेकार जा रहा था; H help में भी इससे जुड़ी कोई key नहीं थी, इसलिए लगता है कि keyboard से भी resize नहीं किया जा सकता
भले ही keyboard से संभव हो, ऐसे मामलों में mouse resize कहीं ज़्यादा आसान और तेज़ है, और टूटे हुए SSH environment जैसे हालात में, जहाँ mouse इस्तेमाल नहीं कर सकते, keyboard adjustment भी हो तो अच्छा होगा
Vim में भी trackpad/mouse जिन हिस्सों में अब भी इस्तेमाल करता हूँ, वे scrolling और window resizing हैं, और SSH के पार भी दोनों उपलब्ध न कर पाने की कोई वजह नहीं है
यहाँ भी यह एक अच्छा additional feature होगा
lazygit को इस project की inspiration के रूप में लिखा गया है, लेकिन lazygit user के तौर पर मैं जानना चाहता हूँ कि क्या कमी थी जिसके लिए पूरी तरह नया project ज़रूरी हो गया
मैं lazygit को बहुत उपयोगी तरीके से इस्तेमाल कर रहा हूँ
RustBerlin meetup presentation के लिए पूरे Linux Git repository को parse करके lazygit, tig, gitui की तुलना की गई थी, और repository में 9 लाख से ज़्यादा commits थे
gituiने 24 सेकंड लिए, memory 0.17GB, binary 1.4MB, कोई freeze नहीं, कोई crash नहीं;lazygitने 57 सेकंड, 2.6GB, 16MB, freeze हुआ, कभी-कभी crash हुआ; औरtigने 4 मिनट 20 सेकंड, 1.3GB, 0.6MB, कभी-कभी freeze, कोई crash नहींमेरी याद में lazygit में न होने वाला कोई feature इसमें नहीं था, बल्कि lazygit में मौजूद कुछ features इसमें गायब थे
ज़्यादातर Git काम terminal में करता हूँ, लेकिन index, commit, diff, stash, blame, log जैसे use cases में Git GUI अक्सर इस्तेमाल करने लगा; कहा गया है कि popular Git GUIs बहुत बड़े repositories में fail हो जाते थे या unresponsive हो जाते थे, इसलिए usable नहीं थे
“popular Git GUIs बहुत बड़े repositories में fail हो जाते हैं या unresponsive हो जाते हैं” वाली बात मैंने सिर्फ़ तब देखी है जब
.gitignoreमें अभी तक न डाली गई बहुत गहरी directory tree की वजह सेgit statuscommand line या magit में बहुत समय लेता हैऐसे मामलों में GUI/TUI/command-line Git इस्तेमाल के बीच कोई फर्क नहीं दिखता
क्या दूसरे Git interfaces, Git खुद से ज़्यादा dramatic तरीके से fail होते हैं?
वही problem होने पर भी command line में
git statusलगभग तुरंत खत्म हो गया थाबहुत सारी information दिखानी हो तो समय लगना unavoidable है, लेकिन magit कुछ points पर बहुत eager तरीके से चलता है और raw Git flow की तुलना में कहीं ज़्यादा महंगा workflow बना देता है
IntelliJ का Git UI Java में लिखा है और IDE के अंदर included है, फिर भी काफी fast है, इसलिए external Git UI में problem नहीं होनी चाहिए
संबंधित पोस्ट:
GitUI: Terminal UI for Git - https://news.ycombinator.com/item?id=32864036 - सितंबर 2022, 90 comments
Terminal-UI for Git written in Rust - https://news.ycombinator.com/item?id=25504811 - दिसंबर 2020, 1 comment
क्या किसी ने Git में click-and-drag UI बनाया है?
मतलब ऐसा UI जिसमें branch को बस drag and drop करके काम किया जा सके
merge, rebase, stage/unstage आदि कई operations के लिए drag and drop support करता है, और शायद और भी चीज़ें होंगी
यह काफी simple Git client है, लेकिन commit cherry-pick जैसे कामों के लिए थोड़ी drag functionality है
https://marketplace.visualstudio.com/items?itemName=trunkflo...
ऐसे tools सब आज़माता हूँ, लेकिन हमेशा कोई core feature missing होता है या मेरे चाहने के तरीके से काम नहीं करता, इसलिए आखिरकार tig पर लौट आता हूँ
GitUI में Log view जैसी जगहों पर branch structure को अच्छी तरह दिखाने वाला visualization नहीं मिला
अच्छा होगा अगर rebase को ध्यान में रखते हुए branch structure को साफ़ दिखाने वाला tool हो
अच्छा लग रहा है, इसलिए एक बार try करने का सोच रहा हूँ
उम्मीद है कि कभी GitExtensions को native Linux application के रूप में port किया जाएगा
दर्जनों UIs इस्तेमाल कर चुका हूँ, लेकिन उसके जैसा कुछ नहीं लगता
context-menu based system को TortoiseGit जितनी naturally इस्तेमाल कराने वाला Git UI अभी तक नहीं मिला
उसके करीब आने वाला दूसरा Git UI सिर्फ़ Tortoise है, हालांकि पहले मैंने सिर्फ़ hg variant इस्तेमाल किया था
Linux पर अब भी 2.x mono version इस्तेमाल कर रहा हूँ
लगभग एक महीने पहले से इस्तेमाल शुरू किए Neovim plugin neogit से यह बहुत मिलता-जुलता दिखता है
key bindings थोड़े rough थे और पूरे workflow की सच में आदत पड़ने में करीब एक घंटा लगा, लेकिन आदत पड़ने के बाद यह मेरे पुराने तरीके—neovim को suspend करके shell में सीधे Git इस्तेमाल करने—से कहीं तेज़ हो गया
0: https://github.com/NeogitOrg/neogit
UI tools को लेकर मेरी एक चिंता यह है कि वे अक्सर actual commands को user से छिपा देते हैं, जिससे बाद में यह reason करना मुश्किल हो जाता है कि क्या गलत हुआ और आगे उससे कैसे बचें
उदाहरण के लिए कोई tool ऐसे काफी opinionated flags लगा सकता है जो सामान्य CLI flow से मेल नहीं खाते
मुझे नहीं पता कि यह इस tool पर लागू होता है या नहीं, लेकिन इस category के tools के लिए यह दिलचस्प feedback हो सकता है
यह हमेशा पूरा command दिखाता है जो चलाया जा रहा है, और पूरा log भी पूरी तरह देखा जा सकता है