Re: Problem with Git rev-list output

2014-08-15 Thread Harlan, Peter
On 2014-08-12 01:10:28 Andrew Crabtree wrote:
 I'm seeing some oddity in one of my repositories where the root commit is 
 being output in 'rev-list' even
 when I pass in a reference that should exclude it from being output.
...
 Seeing the issue with versions of git from 1.7 to 2.1.

I have a small test repo on GitHub that demonstrates the problem.  I expect it 
is caused by the commit dates being out of sequence:

1. Clone the revlist repo:

# git clone https://github.com/pcharlan/revlist.git 
Cloning into 'revlist'...

2. master has six commits (with out-of-order dates):

# git log --pretty='%h %cd' master
0f9e594 Sun May 20 01:01:01 2007 -0700
1ad887b Sun May 20 01:01:01 2007 -0700
cde7188 Sun May 20 01:01:01 2007 -0700
51af1c0 Sun May 20 01:01:01 2007 -0700   -- date seven years ago
0e080e8 Tue Aug 12 11:51:19 2014 -0700  -- present day
77ce973 Fri May 20 01:01:01 2011 -0700  -- three years ago

3. Pruning master with origin/other (a branch with the same root and also 
out-of-order dates) has no effect, counter to expectation:

# git log --pretty='%h %cd' master ^origin/other
0f9e594 Sun May 20 01:01:01 2007 -0700
1ad887b Sun May 20 01:01:01 2007 -0700
cde7188 Sun May 20 01:01:01 2007 -0700
51af1c0 Sun May 20 01:01:01 2007 -0700
0e080e8 Tue Aug 12 11:51:19 2014 -0700
77ce973 Fri May 20 01:01:01 2011 -0700 --- Reachable from origin/other

4. Pruning master with the parent of origin/other removes the root commit:

# git log --pretty='%h %cd' master ^origin/other~
0f9e594 Sun May 20 01:01:01 2007 -0700
1ad887b Sun May 20 01:01:01 2007 -0700
cde7188 Sun May 20 01:01:01 2007 -0700
51af1c0 Sun May 20 01:01:01 2007 -0700
0e080e8 Tue Aug 12 11:51:19 2014 -0700

Q: Is this expected behavior?  If so, and assuming that it's the dates that are 
throwing Git off, is there a way to tell Git to not care about the dates, or to 
care less than it does?

Thanks,

--Pete

Peter Harlan
HP Networking
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Problem with Git rev-list output

2014-08-11 Thread Crabtree, Andrew
I'm seeing some oddity in one of my repositories where the root commit is being 
output in 'rev-list' even when I pass in a reference that should exclude it 
from being output.

I've attempted to reproduce the issue in a test environment but so far have 
failed at that.

Problem details below as best as I can capture them.  

Seeing the issue with versions of git from 1.7 to 2.1.

Thanks,
-Andrew

The root commit is here 

me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
cat-file -p 848de9c422c01c1f724d5c3f615bec476911f59f
tree 5be87811b44f560159d9bb6a10a9fe9bd59147b9
author Migration Script migrat...@gaia.rose.hp.com 1318778853 -0700
committer Gustavo Mora Corrales gustavo.mora.corra...@hp.com 1318778853 -0700

Initial synchronization commit
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
--version
git version 2.1.0.rc2.3.g67de23d
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
merge-base WALLE-J-14-60-GIT_07-DEC-2011 samrom_t4a
848de9c422c01c1f724d5c3f615bec476911f59f
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
rev-list 848de9c422c01c1f724d5c3f615bec476911f59f
848de9c422c01c1f724d5c3f615bec476911f59f
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
rev-list WALLE-J-14-60-GIT_07-DEC-2011 | wc -l 
2132
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
rev-list samrom_t4a | wc -l
316
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
rev-list WALLE-J-14-60-GIT_07-DEC-2011 samrom_t4a | wc -l
2447

# commit is reachable from both references as expected 

me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
rev-list WALLE-J-14-60-GIT_07-DEC-2011 | grep 
848de9c422c01c1f724d5c3f615bec476911f59f
848de9c422c01c1f724d5c3f615bec476911f59f
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
rev-list samrom_t4a | grep 848de9c422c01c1f724d5c3f615bec476911f59f
848de9c422c01c1f724d5c3f615bec476911f59f

# Here -I would have expected --preceding the SHA with -boundary specified
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
rev-list --boundary WALLE-J-14-60-GIT_07-DEC-2011 samrom_t4a | grep 
848de9c422c01c1f724d5c3f615bec476911f59f
848de9c422c01c1f724d5c3f615bec476911f59f

# here I don't expect the SHA to show up with either command line.
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
rev-list WALLE-J-14-60-GIT_07-DEC-2011 ^samrom_t4a | grep 
848de9c422c01c1f724d5c3f615bec476911f59f
848de9c422c01c1f724d5c3f615bec476911f59f
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$ git 
rev-list samrom_t4a ^WALLE-J-14-60-GIT_07-DEC-2011 | grep 
848de9c422c01c1f724d5c3f615bec476911f59f
me@myvm:/pnb/software/userrepos/cache/t4_ghs.git  (BARE:titan4_v14_a)$
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html