<commit_before>;;; extensions.el --- Git Layer Extensions File for Spacemacs
;;
;; Copyright (c) 2012-2014 <NAME>
;; Copyright (c) 2014-2015 <NAME> & Contributors
;;
;; Author: <NAME> <<EMAIL>>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

(setq git-post-extensions '())

(when git-use-magit-next
  (setq git-post-extensions '(magit-next)))

(defun git/init-magit-next ()
  (use-package magit
    :if git-use-magit-next
    :commands (magit-status
               magit-blame-mode
               magit-log
               magit-commit)
    :init
    (progn
      (add-to-list 'load-path (format "%smagit-next/lisp/"
                                      (configuration-layer/get-layer-property
                                       'git :ext-dir)))
      (setq magit-last-seen-setup-instructions "1.4.0"
            magit-completing-read-function 'magit-ido-completing-read)
      (add-hook 'git-commit-mode-hook 'fci-mode)
      ;; must enable auto-fill-mode again because somehow fci-mode disable it
      (add-hook 'git-commit-mode-hook 'auto-fill-mode)
      ;; On Windows, we must use Git GUI to enter username and password
      ;; See: https://github.com/magit/magit/wiki/FAQ#windows-cannot-push-via-https
      (when (eq window-system 'w32)
        (setenv "GIT_ASKPASS" "git-gui--askpass"))

      (defun spacemacs/magit-diff-head ()
        "Execute `magit-diff' against current HEAD."
        (interactive)
        (magit-diff "HEAD"))

      (evil-leader/set-key
        "gb" 'magit-blame-mode
        "gl" 'magit-log
        "gs" 'magit-status
        "gd" 'spacemacs/magit-diff-head
        "gC" 'magit-commit))
    :config
    (progn
      ;; (spacemacs|hide-lighter magit-auto-revert-mode)

      ;; mode maps
      (spacemacs/evilify-map 'magit-mode-map)
      (spacemacs/evilify-map 'magit-status-mode-map 'magit-status-mode)
      (spacemacs/evilify-map 'magit-refs-mode-map 'magit-refs-mode)
      (spacemacs/evilify-map 'magit-blame-mode-map 'magit-blame-mode)
      (spacemacs/evilify-map 'magit-diff-mode-map 'magit-diff-mode)
      (spacemacs/evilify-map 'magit-log-read-revs-map 'magit-log-read-revs)
      (spacemacs/evilify-map 'magit-log-mode-map 'magit-log-mode)
      (spacemacs/evilify-map 'magit-log-select-mode-map 'magit-log-select-mode)
      (spacemacs/evilify-map 'magit-cherry-mode-map 'magit-cherry-mode)
      (spacemacs/evilify-map 'magit-reflog-mode-map 'magit-reflog-mode)
      (spacemacs/evilify-map 'magit-process-mode-map 'magit-process-mode)
      ;; default state for additional modes
      (dolist (mode '(magit-popup-mode
                      magit-popup-sequence-mode))
        (add-to-list 'evil-emacs-state-modes mode))
      (spacemacs/evilify-configure-default-state 'magit-revision-mode)
      ;; section maps
      (spacemacs/evilify-map 'magit-tag-section-map)
      (spacemacs/evilify-map 'magit-untracked-section-map)
      (spacemacs/evilify-map 'magit-branch-section-map)
      (spacemacs/evilify-map 'magit-remote-section-map)
      (spacemacs/evilify-map 'magit-file-section-map)
      (spacemacs/evilify-map 'magit-hunk-section-map)
      (spacemacs/evilify-map 'magit-unstaged-section-map)
      (spacemacs/evilify-map 'magit-staged-section-map)
      (spacemacs/evilify-map 'magit-commit-section-map)
      (spacemacs/evilify-map 'magit-module-commit-section-map)
      (spacemacs/evilify-map 'magit-unpulled-section-map)
      (spacemacs/evilify-map 'magit-unpushed-section-map)
      (spacemacs/evilify-map 'magit-stashes-section-map)
      (spacemacs/evilify-map 'magit-stash-section-map)

      ;; full screen magit-status
      (when git-magit-status-fullscreen
        (defadvice magit-status (around magit-fullscreen activate)
          (window-configuration-to-register :magit-fullscreen)
          ad-do-it
          (delete-other-windows))

        (defun magit-quit-session ()
          "Restores the previous window configuration and kills the magit buffer"
          (interactive)
          (kill-buffer)
          (jump-to-register :magit-fullscreen))
        (define-key magit-status-mode-map (kbd "q") 'magit-quit-session))

      (defun magit-toggle-whitespace ()
        (interactive)
        (if (member "-w" magit-diff-options)
            (magit-dont-ignore-whitespace)
          (magit-ignore-whitespace)))

      (defun magit-ignore-whitespace ()
        (interactive)
        (add-to-list 'magit-diff-options "-w")
        (magit-refresh))

      (defun magit-dont-ignore-whitespace ()
        (interactive)
        (setq magit-diff-options (remove "-w" magit-diff-options))
        (magit-refresh)))
    (define-key magit-status-mode-map (kbd "W") 'magit-toggle-whitespace)))<commit_msg>Implement fullscreen magit status without advices<commit_after>;;; extensions.el --- Git Layer Extensions File for Spacemacs
;;
;; Copyright (c) 2012-2014 <NAME>
;; Copyright (c) 2014-2015 <NAME> & Contributors
;;
;; Author: <NAME> <<EMAIL>>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3

(setq git-post-extensions '())

(when git-use-magit-next
  (setq git-post-extensions '(magit-next)))

(defun git/init-magit-next ()
  (use-package magit
    :if git-use-magit-next
    :commands (magit-status
               magit-blame-mode
               magit-log
               magit-commit)
    :init
    (progn
      (add-to-list 'load-path (format "%smagit-next/lisp/"
                                      (configuration-layer/get-layer-property
                                       'git :ext-dir)))
      (setq magit-last-seen-setup-instructions "1.4.0"
            magit-completing-read-function 'magit-ido-completing-read)
      (add-hook 'git-commit-mode-hook 'fci-mode)
      ;; must enable auto-fill-mode again because somehow fci-mode disable it
      (add-hook 'git-commit-mode-hook 'auto-fill-mode)
      ;; On Windows, we must use Git GUI to enter username and password
      ;; See: https://github.com/magit/magit/wiki/FAQ#windows-cannot-push-via-https
      (when (eq window-system 'w32)
        (setenv "GIT_ASKPASS" "git-gui--askpass"))

      (defun spacemacs/magit-diff-head ()
        "Execute `magit-diff' against current HEAD."
        (interactive)
        (magit-diff "HEAD"))

      (evil-leader/set-key
        "gb" 'magit-blame-mode
        "gl" 'magit-log
        "gs" 'magit-status
        "gd" 'spacemacs/magit-diff-head
        "gC" 'magit-commit))
    :config
    (progn
      ;; (spacemacs|hide-lighter magit-auto-revert-mode)

      ;; mode maps
      (spacemacs/evilify-map 'magit-mode-map)
      (spacemacs/evilify-map 'magit-status-mode-map 'magit-status-mode)
      (spacemacs/evilify-map 'magit-refs-mode-map 'magit-refs-mode)
      (spacemacs/evilify-map 'magit-blame-mode-map 'magit-blame-mode)
      (spacemacs/evilify-map 'magit-diff-mode-map 'magit-diff-mode)
      (spacemacs/evilify-map 'magit-log-read-revs-map 'magit-log-read-revs)
      (spacemacs/evilify-map 'magit-log-mode-map 'magit-log-mode)
      (spacemacs/evilify-map 'magit-log-select-mode-map 'magit-log-select-mode)
      (spacemacs/evilify-map 'magit-cherry-mode-map 'magit-cherry-mode)
      (spacemacs/evilify-map 'magit-reflog-mode-map 'magit-reflog-mode)
      (spacemacs/evilify-map 'magit-process-mode-map 'magit-process-mode)
      ;; default state for additional modes
      (dolist (mode '(magit-popup-mode
                      magit-popup-sequence-mode))
        (add-to-list 'evil-emacs-state-modes mode))
      (spacemacs/evilify-configure-default-state 'magit-revision-mode)
      ;; section maps
      (spacemacs/evilify-map 'magit-tag-section-map)
      (spacemacs/evilify-map 'magit-untracked-section-map)
      (spacemacs/evilify-map 'magit-branch-section-map)
      (spacemacs/evilify-map 'magit-remote-section-map)
      (spacemacs/evilify-map 'magit-file-section-map)
      (spacemacs/evilify-map 'magit-hunk-section-map)
      (spacemacs/evilify-map 'magit-unstaged-section-map)
      (spacemacs/evilify-map 'magit-staged-section-map)
      (spacemacs/evilify-map 'magit-commit-section-map)
      (spacemacs/evilify-map 'magit-module-commit-section-map)
      (spacemacs/evilify-map 'magit-unpulled-section-map)
      (spacemacs/evilify-map 'magit-unpushed-section-map)
      (spacemacs/evilify-map 'magit-stashes-section-map)
      (spacemacs/evilify-map 'magit-stash-section-map)

      ;; full screen magit-status
      (when git-magit-status-fullscreen
	(setq magit-restore-window-configuration t)
	(setq magit-status-buffer-switch-function
	      (lambda (buffer)
		(pop-to-buffer buffer)
		(delete-other-windows))))

      (defun magit-toggle-whitespace ()
        (interactive)
        (if (member "-w" magit-diff-options)
            (magit-dont-ignore-whitespace)
          (magit-ignore-whitespace)))

      (defun magit-ignore-whitespace ()
        (interactive)
        (add-to-list 'magit-diff-options "-w")
        (magit-refresh))

      (defun magit-dont-ignore-whitespace ()
        (interactive)
        (setq magit-diff-options (remove "-w" magit-diff-options))
        (magit-refresh)))
    (define-key magit-status-mode-map (kbd "W") 'magit-toggle-whitespace)))
{'fraction_non_alphanumeric': 0.14276415708396614, 'fraction_numerical': 0.005207203297895422, 'mean_word_length': 2.5348926380368098, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '811290', 'n_tokens_mistral': 3466, 'n_tokens_neox': 3319, 'n_words': 520}