TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Aligning your Git logs

56 点作者 pyrtsa超过 13 年前

5 条评论

matthewsnyder超过 13 年前
I would recommend tig for this sort of thing: <a href="http://jonas.nitro.dk/tig/" rel="nofollow">http://jonas.nitro.dk/tig/</a> In fact, I can't recommend it highly enough. It's typically just as necessary as git on any machine I'm working on.
regularfry超过 13 年前
For those as confused as I was, the code is silently swallowed if you have JavaScript turned off.
评论 #3177318 未加载
masnick超过 13 年前
If you're on a Mac, you'll need to install gawk (at least I did on 10.7).<p>Probably the easiest way to do this is with homebrew[1]:<p><pre><code> brew install gawk </code></pre> [1] If you don't know about homebrew, check out <a href="https://github.com/mxcl/homebrew" rel="nofollow">https://github.com/mxcl/homebrew</a>. It's a package manager for Mac.
MtL超过 13 年前
I usually want to pass arguments to git log, not to less. This is not possible with the default piped alias. This is remedied by wrapping it in a function, and pasting the arguments explicitly to git log using the bash shorthand $@. Here is an updated version of your l80 that supports passing parameters to git log:<p>l = "!f() { git log $@ --abbrev-commit --date=short --pretty=format:'%x00%h%x00%cd%x00%s%x00%an%x00%d' | gawk -F '\\0' '{ printf \"%s\\033[31m%s\\033[0m \\033[32m%s\\033[0m %-80s \\033[30;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, $3, gensub(/(.{79}).{2,}/, \"\\\\1\",\"g\",$4), $5, $6 }' | less -R ; } ; f"
alyandon超过 13 年前
I get a bad config file error when I copy the aliases into my .gitconfig.<p>Edit: Something to do with copy/pasting from the browser. Cloning the gist repository and copying directly in vim works fine.
评论 #3177410 未加载
评论 #3177401 未加载