list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* subtree merge strategy - merge upstream branches that share history
@ 2013-07-11 10:35 Volkmar Glauche
  0 siblings, 0 replies; only message in thread
From: Volkmar Glauche @ 2013-07-11 10:35 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 2240 bytes --]

Dear list,

I would like to set up a repository that has multiple branches from a  
upstream project merged at different paths. Also, I would like to be  
able to access upstream history in my project (it is interpreted code,  
and I would like to git-blame to display a mix of local and upstream  
history line-by-line in the code).
I have documented the steps to demonstrate my desired repository  
layout in the attached shell script snippet. It is self-contained and  
sets up two repositories upstream and main-repo in /tmp. It then reads  
two branches featureA and featureB from upstream into separate paths  
in main-repo.
Then, the script modifies contents in the upstream repository. There  
are modifications that apply to both featureA and featureB as well as  
modifications to one branch only.
Up to this point, things seemed to work well using either git-subtree  
or a combination of git-read-tree and "subtree" merge strategy.
Finally, the changes to upstream are to be pulled into the  
corresponding paths in main-repo. Here, neither git-subtree nor git  
pull with subtree merge do what I want. The changes that apply to one  
of the features only are applied correctly. However, changes from the  
common history of featureA and featureB are only applied to the path  
that is updated first.
Apparently, git records that the common change has been applied and  
doesn't apply it a second time (which is correct for ~99.9999999% of  
all use cases). In this special case however, git does not take into  
account that it applied the common change to a different path.
I found that git pull --squash would apply the right set of updates to  
both featureA and featureB in main-repo (i.e. in this case, the common  
change would be applied on each path). However, this would leave me  
unlinked to upstream history.
1) Am I doing something completely wrong, am I missing some important detail?
2) Am I asking for something impossible?
3) Is it expected behaviour, that --squash adds a different set of  
text changes than a pull without squash?



Freiburg Brain Imaging
Tel. +761 270-54783
Fax. +761 270-54819

[-- Attachment #2: --]
[-- Type: application/x-shellscript, Size: 2780 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-11 10:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-11 10:35 subtree merge strategy - merge upstream branches that share history Volkmar Glauche list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ \
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for project(s) associated with this inbox:

AGPL code for this site: git clone