Re: A new way to get a sha1?
- From
Thomas Badie <thomas.badie@gmail.com>
- Date
- Jul 30, 2012, 16:49 UTC
- Message-ID
- <CAFjFENpqC9MVw4Fx_6rgBsLx8p-5_XGh20Wd4SG17OeyDZg6ag@mail.gmail.com>
- In-Reply-To
- <CAMK1S_hhYi=dLrPy2j28=QMi-UDg7ZGXU=t9WqykVmx3XRyswQ@mail.gmail.com>
2012/7/30 Sitaram Chamarty <sitaramc@gmail.com>:
Show 19 quoted lines
> On Mon, Jul 30, 2012 at 5:41 PM, Thomas Badie <thomas.badie@gmail.com> wrote: >> Hi all, >> >> When I should fixup or squash a commit, I nearly never >> remember how to get the sha1 of the commit I want to fixup. >> Because sometimes HEAD~n is not enough, I make `git log`, >> copy the sha1 of the right commit and paste it in my git >> fixup command. So I wrote a perl script to avoid the usage >> of the mouse. And after discussion with some of my friends, >> this can be generalized as a generic command line interface >> tool to get a sha1. >> >> The idea is to have a perl module which run through >> the log history and print 10 shortlog associated with a number >> from 0 to 9, and a message below "Select commit [| 0, 9 |] or >> next row ?" or this kind of message with several options. > > In general, I prefer nothing to be *interactive*, so I would vote an > emphatic no.
I can understand this. But maybe this is not the case of everyone. People on this mailing-list are developers for several years I think, and this kind of tools may not be helpful for them because they have their own habits. When I decide to propose this, I mostly think about people who are not allergic to interactive tools (this allergy is highly understandable, I just say there is a lot of taste in the world). So maybe it could be an enhancement for git, maybe not.
Show 11 quoted lines
> Also, try "tig" and see if you can customise it. For example, in > order to create a new commit that is meant to be a fixup of some other > commit, I 'git add' what is needed (either command line or tig again) > then hit "m" to the main window, scroll down to the commit concerned, > and hit "=". > > That "=" comes from this line in ~/.tigrc: > > bind main = !git commit --fixup=%(commit) > > Please use such methods to keep interactivity where it belongs, is my opinion.
I already heard about "tig" without trying it. I'll try it as soon as possible. Thanks for your answer.
-- Thomas "Enki" Badie