git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: A new way to get a sha1?

From
Thomas Badie <thomas.badie@gmail.com>
Date
Jul 30, 2012, 16:57 UTC
Message-ID
<CAFjFENp1CzepXLO+eR9A0op6ESRKCTsFLc90e1EKuw1p1A3y5w@mail.gmail.com>
In-Reply-To
<7vipd5s161.fsf@alter.siamese.dyndns.org>
2012/7/30 Junio C Hamano <gitster@pobox.com>:
Show 28 quoted lines
> Jan Engelhardt <jengelh@inai.de> 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 commit and paste it in my git
>>>fixup command. So I wrote a perl script to avoid the usage
>>>of the mouse.
>>
>> If you use screen(1), you can use the keyboard as well; it offers ^A [
>> and ^A ] for copy, and then paste. tmux and all those screen clones
>> probably have something similar. Maybe ratpoison-like WMs do as well.
>> Or, you can use `git log --oneline`, look for the commit and then
>> type the (usually) 6-char part of the hash manually, which may be faster
>> than ^A[, moving the cursor to the copy position, marking it, etc.
>
> Also,
>
>         git show -s ':/^t1100-.*: Fix an interm'
>
> would work well.  It your log messages are not descriptive enough,
> however, that may not, but that is easily fixable by training you
> and your colleages to give a more descriptive title to each commit,
> which will make your project better.

Another aim of this module would be to avoid writing the beginning of the commit message.

Thanks for your proposition. I didn't know this solution.
-- 
Thomas "Enki" Badie
Previous: Junio C HamanoNext: Martin Langhoff
Message 4 of 16 in “A new way to get a sha1?”
  1. Thomas BadieJul 30, 2012
  2. Jan EngelhardtJul 30, 2012
  3. Junio C HamanoJul 30, 2012
  4. Thomas BadieJul 30, 2012
  5. Martin LanghoffJul 30, 2012
  6. Junio C HamanoJul 30, 2012
  7. Martin LanghoffJul 30, 2012
  8. Andreas SchwabJul 30, 2012
  9. Thomas BadieJul 30, 2012
  10. Jeff KingJul 30, 2012
  11. Thomas BadieJul 30, 2012
  12. Andreas SchwabJul 30, 2012
  13. Sitaram ChamartyJul 30, 2012
  14. Thomas BadieJul 30, 2012
  15. Thomas RastJul 30, 2012
  16. Thomas BadieJul 30, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.