Git graph in GNU Emacs

 

Get a decent view of git tree in GNU Emacs (M-x magit-pg-repo).

By default, it draws the graph with last 100 commits. If you want a different behaviour, edit the following constant.

(defconst magit-pg-command
  (concat "git --no-pager log --branches --decorate=full "
          "--pretty=format:\"%H%x00%P%x00%an%x00%ar%x00%s%x00%d\" "
          "-n 100")
  "The command used to fill the raw output buffer.")
 

 

If you want to use the script in terminal (temacs -batch -l $PWD/magit-pretty-graph.el -f magit-pg-repo), add the following path (adjust for versions) to the top of the script and uncomment line 238.

(setq path '("~/.emacs.d/elpa/magit-20220603.1738/"
         "~/.emacs.d/elpa/compat-28.1.1.1/"
         "~/.emacs.d/elpa/dash-20220602.2113/"
         "~/.emacs.d/elpa/magit-section-20220513.1429/"
         "~/.emacs.d/elpa/with-editor-20220506.420/"
         "~/.emacs.d/elpa/git-commit-20220506.1936/"
         )
      load-path (append load-path path))
...
 
;;(message "%s" (with-current-buffer magit-pg-buffer-name (buffer-string)))
 

 

Code

https://github.com/atamariya/magit-pretty-graph/blob/atamariya-patch-1/magit-pretty-graph.el 

 


 

Comments

Popular posts from this blog

GNU Emacs as a Comic Book Reader

Mozilla Readability in GNU Emacs

Data Visualization with GNU Emacs