giterm 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -2
  3. data/giterm +93 -13
  4. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d08422f350db0a6c412976efa59390a7656c829d2b1824727b6ddc0bf2791d95
4
- data.tar.gz: f062623e119308431c2c03223f8cb83c0e3bcbacf6d1c0262e813b6234038e65
3
+ metadata.gz: ff35951790433a2f8aee112a5f1da5753a64076def68327e1a2cf02bd99c0e18
4
+ data.tar.gz: fc8c53303b5b678b21e99b6312f3d93587f83ddb0c809dc51069f9c0b16bc883
5
5
  SHA512:
6
- metadata.gz: 4dbec9b0e38d2137f9722222caa0daf0fad5e12589296cf7d4560720a1a7f551ba4b3501460a3623ee4e9040c22634180d4964cbbcb5661903f37721f62c5688
7
- data.tar.gz: 267e784b7651610f26afdbd1da8ca106eac503d77abc19aac35fc1b74ee4dc17d43e4788e61eb99b26dcc96dd6ab31a8e1fd3f016d7c8279a98453a2a57e7a24
6
+ metadata.gz: b4a1045fe19fbafe0f26a99a0da543d6c0c723d49189ac76fae28c941cd6c357bd8929c1a1e3b6b6f561f58d7fcf6129c82093b6be952467addf6759a8b7ff10
7
+ data.tar.gz: 333992ec11e581dd6821430a30250c32113a58480bb752bb81988296cf9578840e9940be8041e393a39ae1c83403e2ef91cfa37db14855b1b01d8d4354b25211
data/README.md CHANGED
@@ -1,4 +1,11 @@
1
- # GiTerm - Git & GitHub Terminal User Interface
1
+ # GiTerm - Git & GitHub Terminal User Interface
2
+
3
+ <img src="img/giterm_logo.svg" align="left" width="150" height="150">
4
+ <br clear="left"/>
5
+
6
+ [![License](https://img.shields.io/badge/License-Public%20Domain-brightgreen.svg)](https://unlicense.org/)
7
+ [![GitHub stars](https://img.shields.io/github/stars/isene/GiTerm.svg)](https://github.com/isene/GiTerm/stargazers)
8
+ [![Stay Amazing](https://img.shields.io/badge/Stay-Amazing-blue.svg)](https://isene.org)
2
9
 
3
10
  ![Ruby](https://img.shields.io/badge/language-Ruby-red) [![Gem Version](https://badge.fury.io/rb/giterm.svg)](https://badge.fury.io/rb/giterm) ![License](https://img.shields.io/badge/license-Public_Domain-green)
4
11
 
@@ -201,4 +208,4 @@ Public Domain - Use freely for any purpose.
201
208
  ## See Also
202
209
 
203
210
  - [RTFM](https://github.com/isene/RTFM) - Ruby Terminal File Manager
204
- - [rcurses](https://github.com/isene/rcurses) - Ruby curses library used by GiTerm
211
+ - [rcurses](https://github.com/isene/rcurses) - Ruby curses library used by GiTerm
data/giterm CHANGED
@@ -7,7 +7,7 @@
7
7
  # Author: Geir Isene <g@isene.com> (adapted from RTFM)
8
8
  # Github: https://github.com/isene/GiTerm
9
9
  # License: Public domain
10
- @version = '2.0.0'
10
+ @version = '2.0.1'
11
11
 
12
12
  # SAVE & STORE TERMINAL {{{1
13
13
  ORIG_STTY = `stty -g 2>/dev/null`.chomp rescue ''
@@ -236,9 +236,9 @@ def handle_popup_scrolling(popup)
236
236
  popup.linedown
237
237
  when 'k', 'UP'
238
238
  popup.lineup
239
- when 'PgDOWN'
239
+ when 'PgDOWN', 'f' # 'f' as alternative for keyboards without PgDn
240
240
  popup.pagedown
241
- when 'PgUP'
241
+ when 'PgUP', 'F' # 'F' as alternative for keyboards without PgUp
242
242
  popup.pageup
243
243
  when 'ENTER', ' ', 'q', 'ESCAPE'
244
244
  break
@@ -310,8 +310,8 @@ end
310
310
  l/RIGHT = Enter/view details
311
311
  g/HOME = Go to top
312
312
  G/END = Go to bottom
313
- PgDown = Page down in right pane
314
- PgUp = Page up in right pane
313
+ f/PgDn = Page down in left pane
314
+ F/PgUp = Page up in left pane
315
315
  S-RIGHT = Page down in right pane
316
316
  S-LEFT = Page up in right pane
317
317
 
@@ -416,7 +416,7 @@ end
416
416
 
417
417
  def update_bottom_legends
418
418
  # Show key legends in bottom pane
419
- legends = 'j/k:Nav PgUp/PgDn:Page g/G:Top/End J/K:Scroll d:Diff l:Log b:Branches TAB:GitHub q:Quit'
419
+ legends = 'j/k:Nav f/F:Page g/G:Top/End J/K:Scroll d:Diff l:Log b:Branches TAB:GitHub q:Quit'
420
420
  @p_bottom.say(legends)
421
421
  end
422
422
 
@@ -708,12 +708,67 @@ def display_log
708
708
  end
709
709
 
710
710
  def show_commit_details(hash)
711
- details = `git show --stat #{hash} 2>/dev/null`
711
+ # Show full commit with diff, not just stats
712
+ details = `git show #{hash} 2>/dev/null`
712
713
 
713
714
  @p_right.clear
714
715
  @p_right.say(details)
715
716
  end
716
717
 
718
+ def show_branch_details(branch)
719
+ return unless branch
720
+
721
+ @p_right.clear
722
+
723
+ branch_name = branch[:name]
724
+
725
+ # Show branch information
726
+ info = "Branch: #{branch_name}\n\n"
727
+
728
+ if branch[:current]
729
+ info += "Status: Currently checked out\n\n"
730
+ else
731
+ info += "Status: Not checked out\n\n"
732
+ end
733
+
734
+ # Show last 10 commits on this branch
735
+ info += "Recent commits:\n" + '─' * 40 + "\n\n"
736
+
737
+ # Get commit log for this branch
738
+ if branch_name.start_with?('remotes/')
739
+ # For remote branches, use the full name
740
+ log_output = `git log --oneline -10 #{branch_name} 2>/dev/null`
741
+ else
742
+ # For local branches
743
+ log_output = `git log --oneline -10 #{branch_name} 2>/dev/null`
744
+ end
745
+
746
+ if log_output.empty?
747
+ info += "No commits found on this branch\n"
748
+ else
749
+ info += log_output
750
+ end
751
+
752
+ # Show branch tracking info if available
753
+ if !branch_name.start_with?('remotes/')
754
+ tracking = `git rev-parse --abbrev-ref #{branch_name}@{upstream} 2>/dev/null`.strip
755
+ unless tracking.empty?
756
+ info += "\n" + '─' * 40 + "\n"
757
+ info += "Tracking: #{tracking}\n"
758
+
759
+ # Show ahead/behind status
760
+ ahead_behind = `git rev-list --left-right --count #{branch_name}...#{tracking} 2>/dev/null`.strip
761
+ unless ahead_behind.empty?
762
+ ahead, behind = ahead_behind.split("\t")
763
+ info += "Ahead: #{ahead} commits\n" if ahead.to_i > 0
764
+ info += "Behind: #{behind} commits\n" if behind.to_i > 0
765
+ end
766
+ end
767
+ end
768
+
769
+ @p_right.say(info)
770
+ end
771
+
717
772
  def git_branches
718
773
  unless @is_git_repo
719
774
  @p_left.clear
@@ -1707,7 +1762,7 @@ def handle_key(chr)
1707
1762
 
1708
1763
  # Use fast update for major jumps to avoid extended fetch delays
1709
1764
  update_right_pane(true)
1710
- when 'PgDOWN'
1765
+ when 'PgDOWN', 'f' # 'f' as alternative to PageDown for keyboards without PgDn key
1711
1766
  # Page down in left pane
1712
1767
  old_index = @index
1713
1768
  @index = [@index + @p_left.h - 3, @max_index].min
@@ -1743,7 +1798,7 @@ def handle_key(chr)
1743
1798
 
1744
1799
  # Show basic info immediately, schedule extended fetch for when user pauses
1745
1800
  update_right_pane(true)
1746
- when 'PgUP'
1801
+ when 'PgUP', 'F' # 'F' as alternative to PageUp for keyboards without PgUp key
1747
1802
  # Page up in left pane
1748
1803
  old_index = @index
1749
1804
  @index = [@index - @p_left.h + 3, @min_index].max
@@ -2127,8 +2182,33 @@ def update_log_selection(old_index, new_index)
2127
2182
  end
2128
2183
 
2129
2184
  def update_branches_selection(old_index, new_index)
2130
- # Implement if needed for branches mode
2131
- refresh_view
2185
+ return if @branches.empty?
2186
+
2187
+ lines_to_update = []
2188
+
2189
+ # Update old selection (remove marker)
2190
+ if old_index >= 0 && old_index < @branches.length
2191
+ branch = @branches[old_index]
2192
+ if branch[:current]
2193
+ old_line = ' * ' + branch[:name].fg(154)
2194
+ else
2195
+ old_line = ' ' + branch[:name]
2196
+ end
2197
+ lines_to_update << { index: old_index, content: old_line }
2198
+ end
2199
+
2200
+ # Update new selection (add marker)
2201
+ if new_index >= 0 && new_index < @branches.length
2202
+ branch = @branches[new_index]
2203
+ if branch[:current]
2204
+ new_line = '→ * ' + branch[:name].fg(154)
2205
+ else
2206
+ new_line = '→ ' + branch[:name]
2207
+ end
2208
+ lines_to_update << { index: new_index, content: new_line }
2209
+ end
2210
+
2211
+ update_pane_lines(lines_to_update)
2132
2212
  end
2133
2213
 
2134
2214
  def update_github_search_selection(old_index, new_index)
@@ -2257,9 +2337,9 @@ def update_right_pane(fast_update = false)
2257
2337
  end
2258
2338
  end
2259
2339
  when :log
2260
- show_commit_details(@log_entries[@index]) if @index >= 0 && @index < @log_entries.length
2340
+ show_commit_details(@log_entries[@index][:hash]) if @index >= 0 && @index < @log_entries.length
2261
2341
  when :branches
2262
- # Handle branch details if needed
2342
+ show_branch_details(@branches[@index]) if @index >= 0 && @index < @branches.length
2263
2343
  when :github_repos
2264
2344
  log_debug("GitHub repos mode: showing repo #{@index}/#{@github_repos.length}")
2265
2345
  show_repo_details(@github_repos[@index], !fast_update) if @index >= 0 && @index < @github_repos.length
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: giterm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
8
8
  autorequire:
9
9
  bindir: "."
10
10
  cert_chain: []
11
- date: 2025-08-15 00:00:00.000000000 Z
11
+ date: 2025-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rcurses
@@ -54,8 +54,7 @@ dependencies:
54
54
  version: '13.0'
55
55
  description: 'GiTerm is a powerful terminal interface for Git and GitHub, providing
56
56
  an intuitive TUI for repository management, issue tracking, and pull request handling.
57
- Version 2.0.0: Breaking change - requires rcurses 6.0.0+ with explicit initialization
58
- for Ruby 3.4+ compatibility.'
57
+ Version 2.0.2: Fixed macOS branch selection and commit diff display issues.'
59
58
  email:
60
59
  - g@isene.com
61
60
  executables: