Re: A new way to get a sha1?

2012-07-30 Thread Jan Engelhardt
On Monday 2012-07-30 14:11, Thomas Badie 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 >fixu

Re: A new way to get a sha1?

2012-07-30 Thread Sitaram Chamarty
On Mon, Jul 30, 2012 at 5:41 PM, Thomas Badie 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

Re: A new way to get a sha1?

2012-07-30 Thread Junio C Hamano
Jan Engelhardt writes: > On Monday 2012-07-30 14:11, Thomas Badie 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 c

Re: A new way to get a sha1?

2012-07-30 Thread Thomas Rast
Thomas Badie writes: > 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. > > So I ask to the community if

Re: A new way to get a sha1?

2012-07-30 Thread Thomas Badie
2012/7/30 Jan Engelhardt : > On Monday 2012-07-30 14:11, Thomas Badie 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

Re: A new way to get a sha1?

2012-07-30 Thread Thomas Badie
2012/7/30 Sitaram Chamarty : > On Mon, Jul 30, 2012 at 5:41 PM, Thomas Badie 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 o

Re: A new way to get a sha1?

2012-07-30 Thread Jeff King
On Mon, Jul 30, 2012 at 06:40:12PM +0200, Thomas Badie wrote: > I understand your opinion. My solution was a easier way to make your > proposition about `git log --oneline`, because I don't want to copy these > 6 numbers by hand. I'd prefer select the right line simply. > > My solution is intende

Re: A new way to get a sha1?

2012-07-30 Thread Thomas Badie
2012/7/30 Junio C Hamano : > Jan Engelhardt writes: > >> On Monday 2012-07-30 14:11, Thomas Badie 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

Re: A new way to get a sha1?

2012-07-30 Thread Thomas Badie
2012/7/30 Thomas Rast : > Thomas Badie writes: > >> 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. >>

Re: A new way to get a sha1?

2012-07-30 Thread Thomas Badie
2012/7/30 Jeff King : > On Mon, Jul 30, 2012 at 06:40:12PM +0200, Thomas Badie wrote: > >> I understand your opinion. My solution was a easier way to make your >> proposition about `git log --oneline`, because I don't want to copy these >> 6 numbers by hand. I'd prefer select the right line simply.

Re: A new way to get a sha1?

2012-07-30 Thread Andreas Schwab
Thomas Badie writes: > For this case, I don't think I'll use it, but it shows how to use the editor > in a replacement of an interactive tool, and it is interesting. I'd change > vi for emacs but this is religious. If you use emacs anyway you could run the shell inside it, giving you all the pow

Re: A new way to get a sha1?

2012-07-30 Thread Martin Langhoff
On Mon, Jul 30, 2012 at 11:45 AM, Junio C Hamano wrote: > git show -s ':/^t1100-.*: Fix an interm' That doesn't work for me (git 1.7.10.4 as per Fedora 18 rpms) in git.git. But the idea is sound -- git can give you the sha1 trivially. You don't need additional glue. But any ref definitio

Re: A new way to get a sha1?

2012-07-30 Thread Junio C Hamano
Martin Langhoff writes: > On Mon, Jul 30, 2012 at 11:45 AM, Junio C Hamano wrote: >> git show -s ':/^t1100-.*: Fix an interm' > > That doesn't work for me (git 1.7.10.4 as per Fedora 18 rpms) in > git.git. But the idea is sound -- git can give you the sha1 trivially. > You don't need add

Re: A new way to get a sha1?

2012-07-30 Thread Andreas Schwab
Martin Langhoff writes: > But any ref definition can be turned into a sha1 with this snippet: > > git show --pretty=format:%H HEAD git rev-parse HEAD > If you want to get the last 10 sha1s, use the same "pretty" with git log > >git log --pretty=format:%H HEAD | head git rev-

Re: A new way to get a sha1?

2012-07-30 Thread Martin Langhoff
On Mon, Jul 30, 2012 at 2:29 PM, Junio C Hamano wrote: > The idea was that you do not have to give abbreviated SHA-1 to Git > in the first place. Ah, sorry, I didn't get _that_ point. I thought you were trying to demo a way to get a sha1. > What doesn't work? My copy of v1.7.10.1 seems to grok