V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
est
V2EX  ›  git

有没有 GUI git 工具能以一个函数为“中心”,从第一次提交一直看到最新提交?

  •  1
     
  •   est · 2016-05-11 11:02:32 +08:00 · 2440 次点击
    这是一个创建于 2909 天前的主题,其中的信息可能已经有所发展或是发生改变。
    比如固定为 def my_func() ,按照提交顺序 “播放” 一次函数改变历史,同时支持 blame 显示,和跳转到 commit 历史。
    10 条回复    2016-06-02 13:26:26 +08:00
    NemoAlex
        1
    NemoAlex  
       2016-05-11 11:12:17 +08:00
    SourceTree 可以看某个 file 的 log ,应该够方便了。
    精确到某个函数估计不行。
    est
        2
    est  
    OP
       2016-05-11 11:17:47 +08:00
    @NemoAlex 目前用的 sourcetree ,就是不够方便。特别是老代码那种几千行塞一起的。。。
    learnshare
        3
    learnshare  
       2016-05-11 11:27:05 +08:00
    不太可能, Git 是以文件 /行作为片段来存的,不关系具体内容。
    est
        4
    est  
    OP
       2016-05-11 11:37:32 +08:00
    @learnshare 其实命令行是支持的

    git log --oneline -G'^int commit_tree'

    git log -L :myfunction:path/to/myfile.c

    然而命令行用起来并不爽。还有 bash 下正则两次转义的问题。搞得很麻烦。
    taijia
        5
    taijia  
       2016-05-11 11:38:16 +08:00   ❤️ 1
    jetbrains 家的产品对所选的代码块,选中 show history for selection 看看呢
    aliuwr
        6
    aliuwr  
       2016-05-11 11:40:24 +08:00
    Jetbrain 家的 IDE 可以选中函数 /范围之后 Show History for XXXX
    est
        7
    est  
    OP
       2016-05-11 11:42:42 +08:00
    @taijia 看来要买 PyCharm 了。
    itfanr
        8
    itfanr  
       2016-05-11 11:45:30 +08:00
    没有吧
    SpicyCat
        9
    SpicyCat  
       2016-05-11 12:23:29 +08:00
    git log --follow 可以追踪某个文件,然后再在结果里面检索 def my_func() 。这样近似解决你的问题。
    fly2never
        10
    fly2never  
       2016-06-02 13:26:26 +08:00
    @est 弄个社区版好了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1502 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:00 · PVG 01:00 · LAX 10:00 · JFK 13:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.