git-branch--stray 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/git-branch--list--recent +47 -46
- data/lib/git/branch/stray/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38c9d8e1d58db7616ba67ff142d46181937bbb8c198d3464969fc02074bd5cbb
|
4
|
+
data.tar.gz: 25b14cc9e358608d1c1378f2a71a4cbf05bb9e1bf5c58909d41b6d7ac621595a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f330d5f8a402196f23fe001492b35782b1a701e9a89be21043974df040fdd3148c908877b3ebe229cb33bf7bd45b4b2ade49ee7e7eb84ba4308d41ac7771bab1
|
7
|
+
data.tar.gz: 24f6d2ead557c6794e65209ff80b3dc8d1e5b3841f5c87835839ef49b122190e786655b670eb7bd776c54ecf0e726eed1c6c76dccf310fe53ac731eef648e830
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/usr/bin/env
|
1
|
+
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
#
|
4
4
|
# inspiration taken from:
|
@@ -6,50 +6,51 @@
|
|
6
6
|
# https://github.com/paulirish/git-recent
|
7
7
|
#
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
9
|
+
nl = '%0a' # ASCII NEWLINE
|
10
|
+
delim = '%07' # ASCII BELL
|
11
|
+
|
12
|
+
head = '%(if)%(HEAD)%(then)%(end)' # emoji prefix for current branch
|
13
|
+
empty = '%(color:black) %(color:reset)' # to make `column` work correctly
|
14
|
+
|
15
|
+
pattern, deref = if ARGV.delete('--tags')
|
16
|
+
['refs/tags', '*']
|
17
|
+
elsif ARGV.delete('--all')
|
18
|
+
'refs/heads refs/remotes'
|
19
|
+
elsif ARGV.delete('--remotes')
|
20
|
+
'refs/remotes'
|
21
|
+
else
|
22
|
+
'refs/heads'
|
23
|
+
end
|
24
|
+
|
25
|
+
branch_name = '%(refname:short)'
|
26
|
+
branch_name = "%(color:yellow)#{branch_name}%(color:reset)"
|
27
|
+
|
28
|
+
object_name = '%(objectname:short)'
|
29
|
+
object_name = "%(color:red)#{object_name}%(color:reset)"
|
30
|
+
|
31
|
+
commit_date = "%(#{deref}committerdate:relative)"
|
32
|
+
commit_date = "%(color:bold green)(#{commit_date})%(color:reset)"
|
33
|
+
|
34
|
+
author_name = "%(#{deref}authorname)"
|
35
|
+
author_name = "%(color:bold blue)#{author_name}%(color:reset)"
|
36
|
+
|
37
|
+
commit_subject = '%(contents:subject)'
|
38
|
+
|
39
|
+
format = "#{head} #{branch_name}#{delim}"
|
40
|
+
format = "#{format}#{object_name} #{commit_date} #{author_name}"
|
41
|
+
format = "#{format}#{nl}#{empty}#{delim}#{commit_subject}"
|
42
|
+
format = "#{format}#{nl}#{empty}#{delim}" # empty separator line
|
43
|
+
|
44
|
+
require 'shellwords'
|
45
|
+
|
46
|
+
cmd = <<-"EOCMD"
|
47
|
+
git for-each-ref \
|
48
|
+
--color=always \
|
49
|
+
--sort=-committerdate \
|
50
|
+
--format="#{format}" \
|
51
|
+
#{pattern} #{ARGV.shelljoin} | column -t -s $'\a' | less --RAW-CONTROL-CHARS
|
52
|
+
EOCMD
|
53
|
+
|
54
|
+
Kernel.exec(cmd)
|
54
55
|
|
55
56
|
# That's all Folks!
|