File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed
Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4242* fix hunk (un)staging/reset for # of context lines != 3 ([ #1746 ] ( https://github.com/extrawurst/gitui/issues/1746 ) )
4343* fix delay when opening external editor ([ #1506 ] ( https://github.com/extrawurst/gitui/issues/1506 ) )
4444
45+ ### Changed
46+ * Copy full Commit Hash by default [[ @AmmarAbouZor ] ( https://github.com/AmmarAbouZor )] ([ #1836 ] ( https://github.com/extrawurst/gitui/issues/1836 ) )
47+
4548## [ 0.23.0] - 2022-06-19
4649
4750** reset to commit**
Original file line number Diff line number Diff line change @@ -162,37 +162,33 @@ impl CommitList {
162162
163163 pub fn copy_commit_hash ( & self ) -> Result < ( ) > {
164164 let marked = self . marked . as_slice ( ) ;
165- let yank: Option < Cow < str > > = match marked {
165+ let yank: Option < String > = match marked {
166166 [ ] => self
167167 . items
168168 . iter ( )
169169 . nth (
170170 self . selection
171171 . saturating_sub ( self . items . index_offset ( ) ) ,
172172 )
173- . map ( |e| Cow :: Borrowed ( e. hash_short . as_ref ( ) ) ) ,
174- [ ( _idx, commit) ] => {
175- Some ( commit. get_short_string ( ) . into ( ) )
176- }
173+ . map ( |e| e. id . to_string ( ) ) ,
174+ [ ( _idx, commit) ] => Some ( commit. to_string ( ) ) ,
177175 [ first, .., last] => {
178176 let marked_consecutive =
179177 marked. windows ( 2 ) . all ( |w| w[ 0 ] . 0 + 1 == w[ 1 ] . 0 ) ;
180178
181179 let yank = if marked_consecutive {
182180 format ! (
183181 "{}^..{}" ,
184- first. 1 . get_short_string ( ) ,
185- last. 1 . get_short_string ( )
182+ first. 1 . to_string ( ) ,
183+ last. 1 . to_string ( )
186184 )
187185 } else {
188186 marked
189187 . iter ( )
190- . map ( |( _idx, commit) | {
191- commit. get_short_string ( )
192- } )
188+ . map ( |( _idx, commit) | commit. to_string ( ) )
193189 . join ( " " )
194190 } ;
195- Some ( yank. into ( ) )
191+ Some ( yank)
196192 }
197193 } ;
198194
You can’t perform that action at this time.
0 commit comments