EAF Git Client [Emacs高性能 Git 客户端]

@EdmondFrank 大佬已经修复了

已经用上了。谢谢。

最新版增加了很多非图形化界面快捷操作:

  1. eaf-open-git: 打开EAF Git图形客户端, 哈哈哈哈
  2. eaf-git-clone: 直接执行git clone操作
  3. eaf-git-pull: 直接执行git pull操作
  4. eaf-git-push: 直接执行git push操作
  5. eaf-git-show-history: 显示当前光标处代码的编辑历史,比git blame和git log -S都要好用很多
  6. eaf-git-get-permalink: 获取当前光标处的Git Web链接, 比传统打开浏览器用鼠标点击获取URL的方法要高效很多

日志页面也增加了 log_copy_commit_url 的功能,类似 eaf-git-get-permelink, 不用打开浏览器就可以分享当前补丁的URL信息,非常方便。

4 个赞

第一次装 eaf,也是第一次装 eaf-git, eaf-browser 可以用,eaf-open-git 后有错:

Traceback (most recent call last):
  File "<...>/emacs.d/packages/emacs-application-framework/core/utils.py", line 50, in on_signal_received
    self._func(obj, *args, **kwargs)
  File "<...>/emacs.d/packages/emacs-application-framework/eaf.py", line 153, in new_buffer
    self.create_buffer(buffer_id, url, module_path, arguments)
  File "<...>/emacs.d/packages/emacs-application-framework/eaf.py", line 171, in create_buffer
    app_buffer = module.AppBuffer(buffer_id, url, arguments)
  File "<...>/emacs.d/packages/emacs-application-framework/app/git/buffer.py", line 263, in __init__
    self.load_index_html(__file__)
  File "<...>/emacs.d/packages/emacs-application-framework/core/webengine.py", line 1487, in load_index_html
    with open(self.index_file, "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: '<...>/emacs.d/packages/emacs-application-framework/app/git/dist/index.html'

是不是缺个 index.html?

请遵守 GitHub - emacs-eaf/emacs-application-framework: EAF, an extensible framework that revolutionizes the graphical capabilities of Emacs 里面的README, 用 ./install-eaf.py 安装 EAF 和其应用,这个脚本会自动安装应用所需依赖,并编译应用 JS 代码。

你需要删除 eaf-git 目录以后,再用 ./install-eaf.py 安装 git 应用。

EAF的很多应用都是 JavaScript 编写的,不是 git clone 完就可以使用的。

是这么做的,但是中间别的 app 出错,想办法修正以后,再运行 ./install-eaf.py,就没再报错,就以为成功了。

碰到的问题是 eslint 版本冲突,在这里 Issues · emacs-eaf/emacs-application-framework · GitHub 好像几个 app 都是这个错。

现在单装了 git 还是一样的错,解决之后,得手动去 npm install, npm build, 然后 dist 下就有东西了。

但 eaf-open-git 出现了别的错:

qt.webenginecontext: 

GL Type: desktop
Surface Type: OpenGL
Surface Profile: CompatibilityProfile
Surface Version: 4.6
QSG RHI Backend: OpenGL
Using Supported QSG Backend: yes
Using Software Dynamic GL: no
Using Multithreaded OpenGL: yes

Init Parameters:
  *  application-name eaf.py 
  *  browser-subprocess-path <...>/.local/lib/python3.10/site-packages/PyQt6/Qt6/libexec/QtWebEngineProcess 
  *  create-default-gl-context  
  *  disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture 
  *  disable-setuid-sandbox  
  *  disable-speech-api  
  *  disable-web-security  
  *  enable-features NetworkServiceInProcess,TracingServiceInProcess 
  *  enable-gpu-rasterization  
  *  enable-native-gpu-memory-buffers  
  *  enable-threaded-compositing  
  *  ignore-gpu-blocklist  
  *  in-process-gpu  
  *  use-gl desktop 

Traceback (most recent call last):
  File "<...>/config/emacs.d/packages/emacs-application-framework/app/git/buffer.py", line 266, in init_app
    self.init_vars()
  File "<...>/config/emacs.d/packages/emacs-application-framework/app/git/buffer.py", line 293, in init_vars
    (text_color, nav_item_color, info_color, date_color, id_color, match_color, author_color) = get_emacs_func_result(
  File "<...>/config/emacs.d/packages/emacs-application-framework/core/utils.py", line 290, in get_emacs_func_result
    result = epc_client.call_sync("eval-in-emacs", args)
  File "<...>/.local/lib/python3.10/site-packages/epc/handler.py", line 402, in call_sync
    return self._blocking_request(self.call, timeout, name, args)
  File "<...>/.local/lib/python3.10/site-packages/epc/handler.py", line 384, in _blocking_request
    return bc.result(timeout=timeout)
  File "<...>/.local/lib/python3.10/site-packages/epc/handler.py", line 116, in result
    raise reply
epc.handler.ReturnError: [Symbol('error'), 'Format specifier doesn’t match argument type']

Process *eaf* aborted

看到一个类似的错:eaf-open-file-manager run error. · Issue #723 · emacs-eaf/emacs-application-framework · GitHub

不懂 Python,暂时还不会解决。

把 app/git/buffer.py 266 行把 init_vars 的参数都打印一下,我怀疑你的主题某些face没有初始化导致的问题。

绝对是的,我现在在重建配置,主题完全没有,基本上是裸奔状态。一个一个查了一下, 是 “font-lock-negation-char-face” 是 unspecified.

你先把这个颜色设置一下,看看启动有没有问题?

这样就没问题了。多谢,回头主题弄好了应该就没问题了。

1 个赞

请问 index.html 这里具体是怎么解决的,我也遇到了 eslint 的冲突

正确的链接是这个:[EAF] Running npm install 出错,安装不成功 · Issue #975 · emacs-eaf/emacs-application-framework · GitHub

解决了 eslint 问题之后,npm run build 就可以了。

嗯我刚刚看到了这个 issue,这个问题解决了,不过 eaf-open-git 打开还是一片空白。。

得看 eaf 里的错是什么。

弱弱地问一下,这个问题是怎么回事啊

配置

  (add-to-list 'load-path "~/.emacs.d/site-packages/emacs-application-framework/")
  (require 'eaf)]
  (require 'eaf-git)

加载我的doom-themes*eaf*报错:

Fontconfig warning: "/etc/fonts/conf.d/44-wqy-zenhei.conf", line 11: Having multiple values in <test> isn't supported and may not work as expected
Traceback (most recent call last):
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/app/git/buffer.py", line 2100, in run
    (stage_status, unstage_status, untrack_status) = self.parse_status(status)
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/app/git/buffer.py", line 2111, in parse_status
    self.append_file_to_status_list(info, info[1], stage_status, unstage_status, untrack_status)
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/app/git/buffer.py", line 2129, in append_file_to_status_list
    (add_count, delete_count) =self.get_line_info(file, type_key, mime)
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/app/git/buffer.py", line 2168, in get_line_info
    return (len(open(file_path).readlines()), 0)
  File "/usr/lib/python3.10/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf8 in position 844: invalid start byte

emacs -Q 后的*eaf*报错

Fontconfig warning: "/etc/fonts/conf.d/44-wqy-zenhei.conf", line 11: Having multiple values in <test> isn't supported and may not work as expected
Traceback (most recent call last):
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/app/git/buffer.py", line 269, in init_app
    self.init_vars()
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/app/git/buffer.py", line 313, in init_vars
    (text_color, nav_item_color, info_color, date_color, id_color, match_color, author_color) = get_emacs_func_result(
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/core/utils.py", line 258, in get_emacs_func_result
    result = epc_client.call_sync("get-emacs-func-result", [sexp])    # type: ignore
  File "/home/was/.local/lib/python3.10/site-packages/epc/handler.py", line 402, in call_sync
    return self._blocking_request(self.call, timeout, name, args)
  File "/home/was/.local/lib/python3.10/site-packages/epc/handler.py", line 384, in _blocking_request
    return bc.result(timeout=timeout)
  File "/home/was/.local/lib/python3.10/site-packages/epc/handler.py", line 116, in result
    raise reply
epc.handler.ReturnError: [Symbol('error'), 'Format specifier doesn’t match argument type']

已尝试的方案

  • 打印 app/git/buffer.py 中init_vars的参数,输出
H
expanded
expanded
expanded
expanded
collapsed
collapsed

我盲修了一下, 应该修复了, 原因是你的一些文件不是 utf-8 编码的, 导致 EAF Git 读取文件的时候报错, 更新一下吧, 应该没问题了。

谢谢,eaf-git可以正常使用了

eaf-jupyter是不是也要改一下?

Traceback (most recent call last):
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/core/utils.py", line 51, in on_signal_received
    self._func(obj, *args, **kwargs)
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/eaf.py", line 153, in new_buffer
    self.create_buffer(buffer_id, url, module_path, arguments)
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/eaf.py", line 171, in create_buffer
    app_buffer = module.AppBuffer(buffer_id, url, arguments)
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/app/jupyter/buffer.py", line 40, in __init__
    self.add_widget(EafJupyterWidget(self.kernel,
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/app/jupyter/buffer.py", line 62, in __init__
    dark_mode = get_app_dark_mode("eaf-jupyter-dark_mode")
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/core/utils.py", line 262, in get_app_dark_mode
    app_dark_mode = get_emacs_var(app_dark_mode_var)
  File "/home/was/.emacs.d/site-packages/emacs-application-framework/core/utils.py", line 324, in get_emacs_var
    (symbol_value, symbol_is_boolean) = epc_client.call_sync("get-emacs-var", [var_name]) # type: ignore
  File "/home/was/.local/lib/python3.10/site-packages/epc/handler.py", line 402, in call_sync
    return self._blocking_request(self.call, timeout, name, args)
  File "/home/was/.local/lib/python3.10/site-packages/epc/handler.py", line 384, in _blocking_request
    return bc.result(timeout=timeout)
  File "/home/was/.local/lib/python3.10/site-packages/epc/handler.py", line 116, in result
    raise reply
epc.handler.ReturnError: [Symbol('void-variable'), Symbol('eaf-jupyter-dark_mode')]

已经修复, 更新吧。

1 个赞

看到年度回复, 阅读排 第5, 想来再问下

文档也有看, 也可以正常使用, 但有个功能 怎么会没有, 可能我没找到

就是当:

如果 新建了1个 文本文件,或做了 相关的 其它修改动作,

在 eaf-git 界面, 怎么没有自动刷新, 或者 我也没找到 执行刷新命令,

只能关掉 eaf-git, 然后再打开, 才能看到 相关 变动的状态信息