giterm 2.0.1 → 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 +1 -0
  3. data/giterm +84 -4
  4. metadata +2 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 229379dde6560a251c0f3fa707cdff309ce89f88995de14e99e45677555b4d68
4
- data.tar.gz: 07f66329742e50a817683c73a196989c400b6dbf6083eb7e2eccfaa2108052a4
3
+ metadata.gz: ff35951790433a2f8aee112a5f1da5753a64076def68327e1a2cf02bd99c0e18
4
+ data.tar.gz: fc8c53303b5b678b21e99b6312f3d93587f83ddb0c809dc51069f9c0b16bc883
5
5
  SHA512:
6
- metadata.gz: 47193398f0cb94ef112bad6d2619928b56566b5c00befb9a5a67432e6d29ac13f18a020a6a88dbc540d18d5e55773ebac124813e4be2746b4893f89a216dbbb7
7
- data.tar.gz: 4c6e0492c0b70772b42fb494cce31e3108fab5e0fa7c642327f61941c8fc89c9ae908c300e3cb516e09d25aa0673eda73cfad8a1154e3200a7dbb24b372039da
6
+ metadata.gz: b4a1045fe19fbafe0f26a99a0da543d6c0c723d49189ac76fae28c941cd6c357bd8929c1a1e3b6b6f561f58d7fcf6129c82093b6be952467addf6759a8b7ff10
7
+ data.tar.gz: 333992ec11e581dd6821430a30250c32113a58480bb752bb81988296cf9578840e9940be8041e393a39ae1c83403e2ef91cfa37db14855b1b01d8d4354b25211
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # GiTerm - Git & GitHub Terminal User Interface
2
2
 
3
3
  <img src="img/giterm_logo.svg" align="left" width="150" height="150">
4
+ <br clear="left"/>
4
5
 
5
6
  [![License](https://img.shields.io/badge/License-Public%20Domain-brightgreen.svg)](https://unlicense.org/)
6
7
  [![GitHub stars](https://img.shields.io/github/stars/isene/GiTerm.svg)](https://github.com/isene/GiTerm/stargazers)
data/giterm CHANGED
@@ -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
@@ -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)
@@ -2259,7 +2339,7 @@ def update_right_pane(fast_update = false)
2259
2339
  when :log
2260
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: giterm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geir Isene
@@ -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.1: Fixed macOS log display issue and added alternative keybindings for
58
- PageUp/PageDown.'
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: