All of lore.kernel.org
 help / color / mirror / Atom feed
* Show current SHA1
@ 2009-07-11  9:39 Allan Kelly
  2009-07-11  9:55 ` Teemu Likonen
  2009-07-11 11:36 ` Heinrich Nirschl
  0 siblings, 2 replies; 4+ messages in thread
From: Allan Kelly @ 2009-07-11  9:39 UTC (permalink / raw)
  To: git

Hi, hopefully a very simple newb question: "what is the command to
report the current SHA1?" - explanation below.

I'm vc-ing my MSc thesis and associated code with git, it's working
great for me. My supervisor requires regular submissions as editable
Word docs so I publish my source HTML to him as RTF. He adds comments
via Word & returns to me, I read in Open Office 3. This works, but
there is often a week or more between him receiving the doc and
returning it to me with comments.

I'd like to put the current SHA1 as text in the RTF so that I can
generate a diff from my current version before responding to his
comments.

The question then is: what is the command to report the current SHA1?
Note I never branch in the HTML repo, it's entirely linear.

Many thanks, al.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Show current SHA1
  2009-07-11  9:39 Show current SHA1 Allan Kelly
@ 2009-07-11  9:55 ` Teemu Likonen
  2009-07-11 10:16   ` Charles Bailey
  2009-07-11 11:36 ` Heinrich Nirschl
  1 sibling, 1 reply; 4+ messages in thread
From: Teemu Likonen @ 2009-07-11  9:55 UTC (permalink / raw)
  To: Allan Kelly; +Cc: git

On 2009-07-11 10:39 (+0100), Allan Kelly wrote:

> The question then is: what is the command to report the current SHA1?
> Note I never branch in the HTML repo, it's entirely linear.

If the "current SHA1" means "the SHA1 of the most recent commit in the
current branch" then usually

    git show

is the simplest way. There are many ways to print _only_ the SHA1.
Examples:

    git log -1 --pretty=format:%H
    git rev-list -1 HEAD

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Show current SHA1
  2009-07-11  9:55 ` Teemu Likonen
@ 2009-07-11 10:16   ` Charles Bailey
  0 siblings, 0 replies; 4+ messages in thread
From: Charles Bailey @ 2009-07-11 10:16 UTC (permalink / raw)
  To: Teemu Likonen; +Cc: Allan Kelly, git

On Sat, Jul 11, 2009 at 12:55:17PM +0300, Teemu Likonen wrote:
> On 2009-07-11 10:39 (+0100), Allan Kelly wrote:
> 
> > The question then is: what is the command to report the current SHA1?
> > Note I never branch in the HTML repo, it's entirely linear.
> 
> If the "current SHA1" means "the SHA1 of the most recent commit in the
> current branch" then usually
> 
>     git show
> 
> is the simplest way. There are many ways to print _only_ the SHA1.
> Examples:
> 
>     git log -1 --pretty=format:%H
>     git rev-list -1 HEAD

For listing a single commit, I usually think of show and rev-parse
before using commands that list multiple commits. (Of course, having
to use --quiet doesn't make show any shorter than log -1.)

    git rev-parse HEAD
    git show --quiet --pretty=format:%H

-- 
Charles Bailey
http://ccgi.hashpling.plus.com/blog/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Show current SHA1
  2009-07-11  9:39 Show current SHA1 Allan Kelly
  2009-07-11  9:55 ` Teemu Likonen
@ 2009-07-11 11:36 ` Heinrich Nirschl
  1 sibling, 0 replies; 4+ messages in thread
From: Heinrich Nirschl @ 2009-07-11 11:36 UTC (permalink / raw)
  To: Allan Kelly; +Cc: git

On Sat, Jul 11, 2009 at 11:39 AM, Allan Kelly<allankelly@gmail.com> wrote:
> I'd like to put the current SHA1 as text in the RTF so that I can
> generate a diff from my current version before responding to his
> comments.

Instead of doing that, you can put a tag on the version you deliver.

- Henry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-11 11:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-11  9:39 Show current SHA1 Allan Kelly
2009-07-11  9:55 ` Teemu Likonen
2009-07-11 10:16   ` Charles Bailey
2009-07-11 11:36 ` Heinrich Nirschl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.