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
42
42
* fix hunk (un)staging/reset for # of context lines != 3 ([ #1746 ] ( https://github.com/extrawurst/gitui/issues/1746 ) )
43
43
* fix delay when opening external editor ([ #1506 ] ( https://github.com/extrawurst/gitui/issues/1506 ) )
44
44
45
+ ### Changed
46
+ * Copy full Commit Hash by default [[ @AmmarAbouZor ] ( https://github.com/AmmarAbouZor )] ([ #1836 ] ( https://github.com/extrawurst/gitui/issues/1836 ) )
47
+
45
48
## [ 0.23.0] - 2022-06-19
46
49
47
50
** reset to commit**
Original file line number Diff line number Diff line change @@ -162,37 +162,33 @@ impl CommitList {
162
162
163
163
pub fn copy_commit_hash ( & self ) -> Result < ( ) > {
164
164
let marked = self . marked . as_slice ( ) ;
165
- let yank: Option < Cow < str > > = match marked {
165
+ let yank: Option < String > = match marked {
166
166
[ ] => self
167
167
. items
168
168
. iter ( )
169
169
. nth (
170
170
self . selection
171
171
. saturating_sub ( self . items . index_offset ( ) ) ,
172
172
)
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 ( ) ) ,
177
175
[ first, .., last] => {
178
176
let marked_consecutive =
179
177
marked. windows ( 2 ) . all ( |w| w[ 0 ] . 0 + 1 == w[ 1 ] . 0 ) ;
180
178
181
179
let yank = if marked_consecutive {
182
180
format ! (
183
181
"{}^..{}" ,
184
- first. 1 . get_short_string ( ) ,
185
- last. 1 . get_short_string ( )
182
+ first. 1 . to_string ( ) ,
183
+ last. 1 . to_string ( )
186
184
)
187
185
} else {
188
186
marked
189
187
. iter ( )
190
- . map ( |( _idx, commit) | {
191
- commit. get_short_string ( )
192
- } )
188
+ . map ( |( _idx, commit) | commit. to_string ( ) )
193
189
. join ( " " )
194
190
} ;
195
- Some ( yank. into ( ) )
191
+ Some ( yank)
196
192
}
197
193
} ;
198
194
You can’t perform that action at this time.
0 commit comments