Subtree Split Includes Commits Outside Prefix Directory

classic Classic list List threaded Threaded
2 messages Options
ELI
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Subtree Split Includes Commits Outside Prefix Directory

ELI
I attempt a subtree push to a sub-project which I knew not to have had
any local modification since the last subtree push it had received,
but it failed.

To subproject
 ! [rejected]        5a9ad640651d3d54387afa5b7eaf89ed0b392a01 ->
master (non-fast-forward)
error: failed to push some refs to 'subproject'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


The first step I took to understand the cause was to do a subtree
split and inspect the commit history of the resulting branch.  I found
that it contained commits that did not touch any files in the
subproject.  Doing a git show on these commits revealed that they were
not empty commits, but contained diff information for paths in the
main project, and in some cases, other subprojects that exist in the
main project.


I then reviewed the commit history of contrib/subtree/git-subtree.sh
and determined that the last successful subtree push was performed
prior to the integration of this change:
https://git.kernel.org/cgit/git/git.git/commit/contrib/subtree/git-subtree.sh?id=933cfeb90b5d03b4096db6d60494a6eedea25d03

As a next step, I reversed that patch on my local install of git
subtree, and the result was a successful subtree push.


Unfortunately, I have not yet reproduced this with a test main project
and subprojects, and I cannot make the project I observed it in
public.


- Harpreet "Eli" Sangha
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Subtree Split Includes Commits Outside Prefix Directory

David A. Greene
ELI <[hidden email]> writes:

> I then reviewed the commit history of contrib/subtree/git-subtree.sh
> and determined that the last successful subtree push was performed
> prior to the integration of this change:
> https://git.kernel.org/cgit/git/git.git/commit/contrib/subtree/git-subtree.sh?id=933cfeb90b5d03b4096db6d60494a6eedea25d03
>
> As a next step, I reversed that patch on my local install of git
> subtree, and the result was a successful subtree push.

So you're saying that this patch caused a regression?

> Unfortunately, I have not yet reproduced this with a test main project
> and subprojects, and I cannot make the project I observed it in
> public.

I very much want to see a testcase for this.  I'm planning to
fundamentally rewrite the split code this year and want to make sure it
covers everything it does now and fixes a few bugs that have been
exposed lately.

It's tough to revert that patch since it fixed a problem for someone and
we don't have a testcase demonstrating the problem you encountered.  Not
saying your problem isn't important but we need to understand it and
have a way to flag it before fixing or hiding it with a revert of the
above patch.

                       -David
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Loading...