Re: [git-users] How do I find the branch of each parent of a merge commit?

2014-04-01 Thread Philip Oakley
- Original Message - 
  From: Alex Rodrigues 
  To: git-users@googlegroups.com 
  Cc: Alex Rodrigues ; Philip Oakley 
  Sent: Tuesday, April 01, 2014 8:40 PM
  Subject: Re: [git-users] How do I find the branch of each parent of a merge 
commit?


  Also found 
http://stackoverflow.com/questions/2706797/finding-what-branch-a-commit-came-from


  the following command appears to be exactly what I need
git reflog show --all | grep  Now I would need to just parse out the 
branch name :-
You may also want to look at 'git describe' to check for the tags issue (when 
it's not a branch), --contains can be useful as well.
Too many ways to skin cats...
P.

-- 
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 I find the branch of each parent of a merge commit?

2014-04-01 Thread Alex Rodrigues
Also found 
http://stackoverflow.com/questions/2706797/finding-what-branch-a-commit-came-from

the following command appears to be exactly what I need

git reflog show --all | grep  


Now I would need to just parse out the branch name :-)


-- 
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 I find the branch of each parent of a merge commit?

2014-04-01 Thread Alex Rodrigues
Thanks . wanted to make sure there was not already some simple command 
to get what I wanted, and it appears there isn't. Thanks for the links, 
seems to be some promising leads there which help me get to where I want to 
go.

-- 
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 I find the branch of each parent of a merge commit?

2014-03-31 Thread Philip Oakley
- Original Message - 
  From: Alex Rodrigues 
  To: git-users@googlegroups.com 
  Cc: Alex Rodrigues ; Philip Oakley 
  Sent: Monday, March 31, 2014 8:56 PM
  Subject: Re: [git-users] How do I find the branch of each parent of a merge 
commit?


  Perhaps I should explain what I am trying to do.


  We have several project branches where developers commit their code (A 
"project" is a set of related features). The project branches are frequently 
merged to an integration branch where the code is compiled and then deployed 
from. (1 integration branch is created per release)


  If a project is pulled from the release and there is no way to simply 
"disable" it's code, we need to remove that code from the integration branch. 
Since removing code is a tedious process, we normally end up creating a new 
integration view and re-merging the remaining project branches to it which is a 
lot of re-work and time-consuming, thereby causing the project schedule to take 
a hit.


  GIT has a feature called "rerere" that records the conflict resolutions in a 
cache so that it can be later replayed. A few folks have written some scripts 
that make use of "git rerere" and several low level git commands to create a 
new integration branch and re-merge the remaining project branches to it (see 
links below) which is a pretty neat idea. However, if the script encounters a 
merge that came from a tag on a project branch it does not correctly exclude 
it, probably because the "exclude parameter" passed to the script accepts a 
branch name but the script uses "git name-rev" (on each of the parent's 
SHASUMs) to find out the name of the branch which returns the tag name instead 
of the branch where the tag was used to merged from.


  I need to find a way to make this work (i.e. pass project branch name to the 
script's "--exclude" parameter and rely on the script to exclude merged from it 
to the new integration branch.


  
http://www.ivoverberk.nl/blog/2013/11/08/git-workflow-automated-branch-per-feature/
  
http://www.acquia.com/blog/pragmatic-guide-branch-feature-git-branching-strategy


  As you may be able to tell, I am fairly new to GIT and haven't played around 
it for long, so some of my assumptions may be incorrect. Feel free to point 
them out.

[I know the feeling tripping over the many ways of shooting your foo toof in 
Git]

Try
http://stackoverflow.com/questions/1419623/how-to-list-branches-that-contain-a-given-commit
and
http://stackoverflow.com/questions/1862423/git-how-to-tell-which-commit-a-tag-points-to

which may gie you some ideas.

You may have an XYProblem 
http://meta.stackoverflow.com/questions/66377/what-is-the-xy-problem

-- 
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 I find the branch of each parent of a merge commit?

2014-03-31 Thread Alex Rodrigues
Perhaps I should explain what I am trying to do.

We have several project branches where developers commit their code (A 
"project" is a set of related features). The project branches are 
frequently merged to an integration branch where the code is compiled and 
then deployed from. (1 integration branch is created per release)

If a project is pulled from the release and there is no way to simply 
"disable" it's code, we need to remove that code from the integration 
branch. Since removing code is a tedious process, we normally end up 
creating a new integration view and re-merging the remaining project 
branches to it which is a lot of re-work and time-consuming, thereby 
causing the project schedule to take a hit.

GIT has a feature called "rerere" that records the conflict resolutions in 
a cache so that it can be later replayed. A few folks have written some 
scripts that make use of "git rerere" and several low level git commands to 
create a new integration branch and re-merge the remaining project branches 
to it (see links below) which is a pretty neat idea. However, if the script 
encounters a merge that came from a tag on a project branch it does not 
correctly exclude it, probably because the "exclude parameter" passed to 
the script accepts a branch name but the script uses "git name-rev" (on 
each of the parent's SHASUMs) to find out the name of the branch which 
returns the tag name instead of the branch where the tag was used to merged 
from.

I need to find a way to make this work (i.e. pass project branch name to 
the script's "--exclude" parameter and rely on the script to exclude merged 
from it to the new integration branch.

http://www.ivoverberk.nl/blog/2013/11/08/git-workflow-automated-branch-per-feature/
http://www.acquia.com/blog/pragmatic-guide-branch-feature-git-branching-strategy

As you may be able to tell, I am fairly new to GIT and haven't played 
around it for long, so some of my assumptions may be incorrect. Feel free 
to point them out.

>

-- 
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 I find the branch of each parent of a merge commit?

2014-03-29 Thread Philip Oakley
- Original Message - 
  From: Alex Rodrigues 
  To: git-users@googlegroups.com 
  Sent: Saturday, March 29, 2014 3:22 AM
  Subject: [git-users] How do I find the branch of each parent of a merge 
commit?


  I would like to find the branches that contributed to a commit that was the 
result of a merge. If I am able to find the SHASUM of each of the versions that 
contributed to the merge (i.e. the parents), how can I get the branch of each 
of the parents? Note that the merge could have been done from the branch or 
from a tag on the branch.
Branch names are generally ephemeral (i.e. temporary) so it is not possible in 
an absolute sense to determine which branch name a merge came from - the name 
can be deleted after a merge.

a normal merge commit does record what was merged as text, so you can read that 
if it hasn't been modified.

Also the merge does record the sha1's of both it's parents (or multi-parents!) 
as part of the DAG (directed acyclic graph ~ linked list) so you can see the 
sha1 of the second parent and follow that line of commits if you want to see 
the actual content and who made those mergexd commits (which is more reliable 
for allocating 'Blame'!)

Philip.

-- 
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.


[git-users] How do I find the branch of each parent of a merge commit?

2014-03-28 Thread Alex Rodrigues
I would like to find the branches that contributed to a commit that was the 
result of a merge. If I am able to find the SHASUM of each of the versions 
that contributed to the merge (i.e. the parents), how can I get the branch 
of each of the parents? Note that the merge could have been done from the 
branch or from a tag on the branch.

-- 
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.