RE: [git-users] How do you find the latest "revision" of agit repo branch?

2016-02-11 Thread Suu Quan
Thanks to Konstantin and Gergely for the insight.

Ref: rebuild based on commit ID
I think I'm going to accept the risk of building again in those situations in 
the first implementation phase, with a note on improving it -with git diff- in 
phase 2.

I wonder if there is a Jenkins/Hudson plugin for git that took those situations 
into consideration.

-Original Message-
From: Konstantin Khomoutov [mailto:flatw...@users.sourceforge.net] 
Sent: Thursday, February 11, 2016 1:56 AM
To: git-users@googlegroups.com
Cc: Gergely Polonkai
Subject: Re: [git-users] How do you find the latest "revision" of agit repo 
branch?

On Thu, 11 Feb 2016 08:04:16 +0100
Gergely Polonkai <gerg...@polonkai.eu> wrote:

> even though the SHA1 commit ID can be looked at, a changing commit ID 
> doesn't mean changed code. What if you hat two commits since the last 
> build, one that adds a change and another that reverts it? You are 
> seeing the same code, yet you rebuild it.
> 
> If you don't have a decent build system that can do incremental 
> builds, you may want to stick with git diff. You already have the 
> previous build's commit ID, so you can do git diff old-id HEAD. If 
> anything changed, do a build. If you pass --stat to git diff, you will 
> get the list of changed files, so you can make a decision if you 
> really need to build (e.g. no build if only the README file changed.). 
> This technique may be actually applied to other VCSes.

I'd vote for this answer, too.

To the OP: it worth keeping in mind that in Subversion, revision numbers are 
repository-wide, so to say that if a revision has changed, the content of a 
branch has changed, too, is not really correct.

--
You received this message because you are subscribed to a topic in the Google 
Groups "Git for human beings" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/git-users/SZLgNLm_wrg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How do you find the latest "revision" of agit repo branch?

2016-02-11 Thread Konstantin Khomoutov
On Thu, 11 Feb 2016 08:04:16 +0100
Gergely Polonkai  wrote:

> even though the SHA1 commit ID can be looked at, a changing commit ID
> doesn't mean changed code. What if you hat two commits since the last
> build, one that adds a change and another that reverts it? You are
> seeing the same code, yet you rebuild it.
> 
> If you don't have a decent build system that can do incremental
> builds, you may want to stick with git diff. You already have the
> previous build's commit ID, so you can do git diff old-id HEAD. If
> anything changed, do a build. If you pass --stat to git diff, you
> will get the list of changed files, so you can make a decision if you
> really need to build (e.g. no build if only the README file
> changed.). This technique may be actually applied to other VCSes.

I'd vote for this answer, too.

To the OP: it worth keeping in mind that in Subversion, revision
numbers are repository-wide, so to say that if a revision has changed,
the content of a branch has changed, too, is not really correct.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How do you find the latest "revision" of agit repo branch?

2016-02-10 Thread Gergely Polonkai
Hello,

even though the SHA1 commit ID can be looked at, a changing commit ID
doesn't mean changed code. What if you hat two commits since the last
build, one that adds a change and another that reverts it? You are seeing
the same code, yet you rebuild it.

If you don't have a decent build system that can do incremental builds, you
may want to stick with git diff. You already have the previous build's
commit ID, so you can do git diff old-id HEAD. If anything changed, do a
build. If you pass --stat to git diff, you will get the list of changed
files, so you can make a decision if you really need to build (e.g. no
build if only the README file changed.). This technique may be actually
applied to other VCSes.

Best,
Gergely
On Feb 11, 2016 12:37 AM, "Suu"  wrote:

> Before I build/compile a git branch, I would like to know whether it has
> changed since the last time I built it.
> If no change, I won't bother to build.
>
> in Subversion, it's a "revision number" that identifies the whole set of
> source code at the time. If you commit another set of changes to the
> branch, you get a new "revision number"
>
> What is its equivalent in GIT? (commit SHA-1 number?)
>
> How do I get that value? (git log -p 1?)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How do you find the latest "revision" of agit repo branch?

2016-02-10 Thread Leam Hall

Also, a free on-line book:   https://git-scm.com/book/en/v2

On 02/10/16 18:37, Suu wrote:

Before I build/compile a git branch, I would like to know whether it has
changed since the last time I built it.
If no change, I won't bother to build.

in Subversion, it's a "revision number" that identifies the whole set of
source code at the time. If you commit another set of changes to the
branch, you get a new "revision number"

What is its equivalent in GIT? (commit SHA-1 number?)

How do I get that value? (git log -p 1?)

--
You received this message because you are subscribed to the Google
Groups "Git for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to git-users+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] How do you find the latest "revision" of agit repo branch?

2016-02-10 Thread Magnus Therning

Suu writes:

> Before I build/compile a git branch, I would like to know whether it has 
> changed since the last time I built it.
> If no change, I won't bother to build.
>
> in Subversion, it's a "revision number" that identifies the whole set of 
> source code at the time. If you commit another set of changes to the 
> branch, you get a new "revision number"
>
> What is its equivalent in GIT? (commit SHA-1 number?)
>
> How do I get that value? (git log -p 1?)

git show-ref HEAD

will show you the shasum of HEAD. You can replace 'HEAD' by any other
ref (run `git show-ref` to see a list of them all).

/M

-- 
Magnus Therning  OpenPGP: 0x927912051716CE39
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

Java is, in many ways, C++--.
 -- M Feldman

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [git-users] How do you find the latest "revision" of agit repo branch?

2016-02-10 Thread Leam Hall
Hmm...depends. Yes, the git hash will be the same if you're on the same 
version. How manual do you want it to be? "git status" will show you the 
status but isn't manual.


You can "git log | head -1' for the commit hash, if that's what you 
want. For example:


git log | head -1
commit bfbe91980accf14820fddf1167351fd6dffc6a14



On 02/10/16 18:37, Suu wrote:

Before I build/compile a git branch, I would like to know whether it has
changed since the last time I built it.
If no change, I won't bother to build.

in Subversion, it's a "revision number" that identifies the whole set of
source code at the time. If you commit another set of changes to the
branch, you get a new "revision number"

What is its equivalent in GIT? (commit SHA-1 number?)

How do I get that value? (git log -p 1?)

--
You received this message because you are subscribed to the Google
Groups "Git for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to git-users+unsubscr...@googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.