git_spelunk 0.5.1 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f571a8a5c7f7c2e3d00e1b104353202244f01ea94e789f1783b416b941586c0
4
- data.tar.gz: 9327729f1087501a9865f17b03eac8e2b833733766909441357df7b2e2f3da43
3
+ metadata.gz: c66d56a219163151155944e5d2887a20dda14eccc960970055511c4c1359cdd7
4
+ data.tar.gz: 1a2a34353a2b890cfad240dc10ce839bb59609714c0985d3e8c5a80926ece56e
5
5
  SHA512:
6
- metadata.gz: cbe0f470a68bfd871f0c2872ca7937d7162b995306ed1c27f0404356d4e488248661a93d81610a2d5d53381843d2e7319c5101ce6bc41866da98767661cc7447
7
- data.tar.gz: 5ad729cf39617c9b2b5474f64ac9c34d2149f6cf47a5c6dfbd86d6d6c1585b4d67b8947acbce625f990abacd5229b1e69893ae4553ed0aacf947c0dda1dbb87d
6
+ metadata.gz: ef3b413679e551d6d098645f38e840e9cd9ea31f6f41fc987e5294946ba29ac5d7f74e3afd90041c528c9dbfbeb5e1aedd4a0efc9f894856c1a57b28cd946de5
7
+ data.tar.gz: cdb32f7a7dcf9059573350e37780ba78d0c6e1628e305444a446cca997c4f73bed496102772f7e32450b5caabcf5cf8b701e980bae3d0b199b448fc28cbcde91
@@ -19,7 +19,6 @@ module GitSpelunk
19
19
  end
20
20
 
21
21
  def process_raw_blame(output)
22
- lines = []
23
22
  commits = {}
24
23
  commit_file_map = {}
25
24
 
@@ -16,7 +16,6 @@ module GitSpelunk
16
16
  end
17
17
 
18
18
  @file = File.expand_path(file).sub(@repo.workdir, '')
19
- @commit_cache = {}
20
19
  end
21
20
 
22
21
  def clone_for_blame_line(blame_line)
@@ -30,19 +29,14 @@ module GitSpelunk
30
29
  end
31
30
 
32
31
  def find_repo_from_file(file)
33
- Rugged::Repository.discover(file)
32
+ Rugged::Repository.discover(File.dirname(file))
34
33
  end
35
34
 
36
35
  def get_blame
37
- @blame_data ||= begin
38
- @new_to_old = {}
39
- @line_to_sha = {}
40
- GitSpelunk::Blame.new(@repo, @file, @sha).lines
41
- end
36
+ @blame_data ||= GitSpelunk::Blame.new(@repo, @file, @sha).lines
42
37
  end
43
38
 
44
39
  def get_line_commit_info(blame_line)
45
- get_blame
46
40
  commit = blame_line.commit
47
41
  return nil unless commit
48
42
  author = commit.author
@@ -43,7 +43,6 @@ module GitSpelunk
43
43
  @line_number = line_number
44
44
  @commit = @repo.lookup(@sha)
45
45
  @parent = @commit.parents[0]
46
- true
47
46
  end
48
47
 
49
48
  STATS_PATTERN=/@@ \-(\d+),(\d+) \+(\d+),(\d+) @@/
@@ -134,14 +133,6 @@ module GitSpelunk
134
133
  end
135
134
  end
136
135
 
137
- def at_beginning_of_time?
138
- @parent.nil?
139
- end
140
-
141
- def unable_to_trace_lineage?
142
- @parent && (@hunks.nil? || target_chunk.nil?)
143
- end
144
-
145
136
  def line_number_to_parent
146
137
  return :at_beginning_of_time unless @parent && hunks
147
138
  chunk = target_chunk(@line_number)
@@ -34,7 +34,7 @@ module GitSpelunk
34
34
  view3, style3 = @status.draw
35
35
 
36
36
  cursor = if typing?
37
- [@pager_height + @repo_height, @status.command_buffer.size + 1]
37
+ [@pager.height + @repo.height, @status.command_buffer.size + 1]
38
38
  else
39
39
  [Curses.lines-1, Curses.cols]
40
40
  end
@@ -80,7 +80,7 @@ Date: #{info[:date]}
80
80
  def history_back
81
81
  @status.set_onetime_message("Rewinding...")
82
82
  goto = @file_context.get_line_for_sha_parent(@pager.blame_line)
83
- if goto.is_a?(Fixnum)
83
+ if goto.is_a?(Integer)
84
84
  @file_context.line_number = @pager.cursor
85
85
  @history.push(@file_context)
86
86
 
@@ -165,7 +165,7 @@ Date: #{info[:date]}
165
165
  when 's'
166
166
  sha = @pager.blame_line.sha
167
167
  Curses.close_screen
168
- system("git -p --git-dir='#{@file_context.repo.path}' show #{sha} | less")
168
+ system("git -p --git-dir='#{@file_context.repo.path}' show #{sha} | less -R")
169
169
  when '/', '?'
170
170
  @status.command_buffer = key
171
171
  @typing = :search
@@ -1,3 +1,3 @@
1
1
  module GitSpelunk
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_spelunk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Osheroff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-01-05 00:00:00.000000000 Z
12
+ date: 2023-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rugged