Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
758dc0cc
Commit
758dc0cc
authored
Feb 18, 2008
by
Thien-Thi Nguyen
Browse files
(vc-git-after-dir-status, vc-git-dir-status): New funcs.
parent
91784462
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
lisp/ChangeLog
lisp/ChangeLog
+4
-0
lisp/vc-git.el
lisp/vc-git.el
+47
-0
No files found.
lisp/ChangeLog
View file @
758dc0cc
2008-02-18 Thien-Thi Nguyen <ttn@gnuvola.org>
* vc-git.el (vc-git-after-dir-status, vc-git-dir-status): New funcs.
2008-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
* image-mode.el (image-get-display-property): New fun.
...
...
lisp/vc-git.el
View file @
758dc0cc
...
...
@@ -207,6 +207,53 @@
;; fall back to the default VC representation
(
vc-default-dired-state-info
'Git
file
))))
;;; vc-dir-status support (EXPERIMENTAL)
;;; If vc-directory (which is not half bad under Git, w/ some tweaking)
;;; is to go away, vc-dir-status must at least support the same operations.
;;; At the moment, vc-dir-status design is still fluid (a kind way to say
;;; half-baked, undocumented, and spottily-supported), so the following
;;; should be considered likewise ripe for sudden unannounced change.
;;; YHBW, HAND. --ttn
(
defun
vc-git-after-dir-status
(
callback
buffer
)
(
sort-regexp-fields
t
"^. \\(.+\\)$"
"\\1"
(
point-min
)
(
point-max
))
(
let
((
map
'
((
?H
.
cached
)
(
?M
.
unmerged
)
(
?R
.
removed
)
(
?C
.
edited
)
(
?K
.
removed
)
; ??? "to be killed"
(
??
.
unregistered
)))
status
filename
result
)
(
goto-char
(
point-min
))
(
while
(
>
(
point-max
)
(
point
))
(
setq
status
(
string-to-char
(
buffer-substring
(
point
)
(
1+
(
point
))))
status
(
cdr
(
assq
status
map
))
filename
(
buffer-substring
(
+
2
(
point
))
(
line-end-position
)))
;; TODO: Add dynamic selection of which status(es) to display, and
;; bubble that up to vc-dir-status. For now, we consider `cached'
;; to be uninteresting, to mimic vc-directory (somewhat).
(
unless
(
eq
'cached
status
)
(
push
(
cons
filename
status
)
result
))
(
forward-line
1
))
(
funcall
callback
result
buffer
)))
(
defun
vc-git-dir-status
(
dir
update-function
status-buffer
)
"Return a list of conses (file . state) for DIR."
(
with-current-buffer
(
get-buffer-create
(
expand-file-name
" *VC-Git* tmp status"
dir
))
(
erase-buffer
)
(
vc-git-command
(
current-buffer
)
'async
dir
"ls-files"
"-t"
"-c"
; cached
"-d"
; deleted
"-k"
; killed
"-m"
; modified
"-o"
; others
"--directory"
"--exclude-per-directory=.gitignore"
)
(
vc-exec-after
`
(
vc-git-after-dir-status
(
quote
,
update-function
)
,
status-buffer
))))
;;; STATE-CHANGING FUNCTIONS
(
defun
vc-git-create-repo
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment