【问题标题】:Is there an equivalence to git lol and git lola with mercurial?git lol 和 git lola 是否与 mercurial 等价?
【发布时间】:2020-08-28 14:16:23
【问题描述】:

我在 命令行 中使用 mercurial,我想知道 git lolgit lola 是否等效?

分别是:

lol = log --graph --decorate --pretty=oneline --abbrev-commit

lola = log --graph --decorate --pretty=oneline --abbrev-commit --all --date=local

我尝试用 hg log 查找一些信息,但没有任何成功...

编辑:它会是这样的:

hg log -G -T "{node|short} - ({branch}) {desc|strip|firstline}"

【问题讨论】:

  • 你能定义“git lol”和“git lola”(它们不是 git 本身的一部分)吗?
  • 是的,对不起。我编辑了我的问题。
  • 谢谢,好多了。
  • 顺便说一句,--pretty=oneline --abbrev-commit == --oneline
  • 哦...是的,你是对的! ^^'

标签: git mercurial


【解决方案1】:

简答

是的,有可能,只需阅读hg help log + hg help templating

更长的答案

我太懒得阅读https://git-scm.com/docs/git-log 中的文字墙,因此:如果您以可读的形式描述git log 的每个使用的选项,我会找到 hg 等价物快速简单(对于存在于 hg 实体中的引用,f.e,在 --decorate 中使用的纯粹是 Git 的玩具)

编辑:

我会建议:

  • 略微改进的模板版本(您可以选择任何需要的日期格式而不是isodate)

    -T "{node|short} {separate(' ',bookmarks,tags)} - ({branch}) {desc|strip|firstline} {date|localdate|isodate}"

  • [templates] 部分定义模板(用于简化用法hg log -T lol),smth。喜欢

[templates]

lol = "{node|short} {separate(' ',bookmarks,tags)} - ({branch}) {desc|strip|firstline} {date|localdate|isodate}"

可能为重音标签、书签、日志字符串中的分支添加颜色

  • 也许添加 lol (lola) 作为 hg 别名
[alias]
    
lol = log -G -T lol

【讨论】:

  • 谢谢!我不知道模板的存在......阅读文档我可以找到我想要的东西。仍然需要改进它,但现在已经足够了。非常感谢!
猜你喜欢
  • 1970-01-01
  • 2011-01-17
  • 1970-01-01
  • 2021-11-24
  • 1970-01-01
  • 2017-09-23
  • 1970-01-01
  • 1970-01-01
  • 2010-11-29
相关资源
最近更新 更多