All of lore.kernel.org
 help / color / mirror / Atom feed
* Rebase fail with new file
@ 2014-02-06 20:11 Lee Carver
  0 siblings, 0 replies; only message in thread
From: Lee Carver @ 2014-02-06 20:11 UTC (permalink / raw)
  To: git

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

GitDev -


During a rebase of a feature branch to the master branch, I lost a new
file in a new directory.  I was able to recover by replaying the
rebase and taking exceptional actions.  However, I'm left with the
impression the git does not handle new files properly under some
rebase situations and gives the wrong advice to users.


I was able to recover by reseting the branch to the pre-rebase commit,
repeating the rebase, and manually applying the
.git/rebase-apply/patch at the critical point.  I do not understand
why the patch did not work through the rebase command.


Additionally, the git recommendation that after the failed patch, with
no local changes, a [git rebase --skip] is a likely resolution is just
wrong.  Skipping after a complete patch failure lead me to very broken
working directory.


Details follow, and the contents of the problematic commit are
attached (from [git show 2e9b460]).


Thanks

   Lee


This occurs with git version 1.8.3.2


[1024] $ git --version

git version 1.8.3.2


*** Details ***


Initial setup:  After working in branch feature/build-projects for
several days (with ~21 commits+pushes from branch point), I needed to
integrate new changes from the master branch.  Here are the steps from
my bash history:


  879  git checkout master

  880  git pull

  881  git checkout feature/build-projects

  882  git rebase master


There were a couple of conflicts, which I resolved and moved on with
[git rebase --continue].


At approximately the 14th commit, the rebase stopped with this message:


<bash>


Applying: STRY0057770: Add -Z parent for late build modules.

Using index info to reconstruct a base tree...

Falling back to patching base and 3-way merge...

error: Your local changes to the following files would be overwritten by merge:

glide-app-itbm/pom.xml

Please, commit your changes or stash them before you can merge.

Aborting

Failed to merge in the changes.

Patch failed at 0014 STRY0057770: Add -Z parent for late build modules.

The copy of the patch that failed is found in:

   /Users/lee.carver/Service-now/dev/glide04/git/glide/.git/rebase-apply/patch


When you have resolved this problem, run "git rebase --continue".

If you prefer to skip this patch, run "git rebase --skip" instead.

To check out the original branch and stop rebasing, run "git rebase --abort".

</bash>



Git status indicated no change, and inspection of the
glide-app-itbm/pom.xml showed no conflicts or unexpected content:


<bash>

[888] $ git status

# HEAD detached from ee6d51c

# You are currently rebasing branch 'feature/build-projects' on 'ee6d51c'.

#   (all conflicts fixed: run "git rebase --continue")

#


When I tried to  [git rebase --continue], the error message provided a
little more information.  Specifically, it mentions the added (new)
file glide-module-parent-z/pom.xml.


[904] $ git rebase --continue

Applying: STRY0057770: Add -Z parent for late build modules.

Applying: STRY0057770: Provide version properties for diagrammer and
email-notification.

Using index info to reconstruct a base tree...

M glide-app-itbm/pom.xml

A glide-module-parent-z/pom.xml

Falling back to patching base and 3-way merge...

Auto-merging glide-module-parent/pom.xml

Auto-merging glide-app-itbm/pom.xml

CONFLICT (content): Merge conflict in glide-app-itbm/pom.xml

Failed to merge in the changes.

Patch failed at 0015 STRY0057770: Provide version properties for
diagrammer and email-notification.

The copy of the patch that failed is found in:

   /Users/lee.carver/Service-now/dev/glide04/git/glide/.git/rebase-apply/patch


When you have resolved this problem, run "git rebase --continue".

If you prefer to skip this patch, run "git rebase --skip" instead.

To check out the original branch and stop rebasing, run "git rebase --abort".

</bash>



I made a minor edit to the glide-app-itbm/pom.xml (adding a "-z" to
the parent name), [git add -u], and then [git rebase --continue].


There were a couple of addition conflicts, some resolved with
--continue, some with --skip.


In the end, I was left with a working direction that did not contain
the new file glide-module-parent-z/pom.xml or other changes from the
problematic commit/rebase step (STRY0057770: Add -Z parent for late
build modules.).


*** Recovery ***


I was able to recover the branch, and complete the rebase with the
expected results only by manually applying the patch file at the
critical rebase step:


Starting in the feature branch, these actions were performed:


  928  git reset --hard 6793d9f

  930  git checkout master

  931  git pull

  932  git checkout feature/build-projects

  934  git rebase master


When the rebase of (STRY0057770: Add -Z parent for late build
modules.) stopped, I manually applied the patch


  959  git apply .git/rebase-apply/patch


With the appropriate adds, etc. I was able to [git rebase --continue]
to a successful conclusion.

[-- Attachment #2: 2e9b460.out --]
[-- Type: application/octet-stream, Size: 9882 bytes --]

commit 2e9b460c50358616da2d4ec62bc3038da6cf5dad
Author: Lee Carver <lee.carver@servicenow.com>
Date:   Tue Feb 4 13:51:14 2014 -0800

    STRY0057770: Add -Z parent for late build modules.
    
    Maven's release tool thinks the shared parent has the wrong version
    when we build the components in multiple stages.

diff --git a/glide-app-itbm/pom.xml b/glide-app-itbm/pom.xml
index 4f41fbb..6ea61a2 100644
--- a/glide-app-itbm/pom.xml
+++ b/glide-app-itbm/pom.xml
@@ -3,10 +3,11 @@
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>com.snc</groupId>
-		<artifactId>glide-module-parent</artifactId>
+		<artifactId>glide-module-parent-z</artifactId>
 		<version>5.0.0.0-SNAPSHOT</version>
-		<relativePath>../glide-module-parent/pom.xml</relativePath>
+		<relativePath>../glide-module-parent-z/pom.xml</relativePath>
 	</parent>
+
 	<artifactId>glide-app-itbm</artifactId>
 	<name>IT Business Management applications</name>
 	
diff --git a/glide-autotester/pom.xml b/glide-autotester/pom.xml
index ad7e17e..a63bf82 100644
--- a/glide-autotester/pom.xml
+++ b/glide-autotester/pom.xml
@@ -3,10 +3,11 @@
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>com.snc</groupId>
-		<artifactId>glide-module-parent</artifactId>
+		<artifactId>glide-module-parent-z</artifactId>
 		<version>5.0.0.0-SNAPSHOT</version>
-		<relativePath>../glide-module-parent/pom.xml</relativePath>
+		<relativePath>../glide-module-parent-z/pom.xml</relativePath>
 	</parent>
+
 	<artifactId>glide-autotester</artifactId>
 	<name>Glide Autotester</name>
 
diff --git a/glide-cms/pom.xml b/glide-cms/pom.xml
index 7e44020..fdebd35 100644
--- a/glide-cms/pom.xml
+++ b/glide-cms/pom.xml
@@ -3,10 +3,11 @@
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>com.snc</groupId>
-		<artifactId>glide-module-parent</artifactId>
+		<artifactId>glide-module-parent-z</artifactId>
 		<version>5.0.0.0-SNAPSHOT</version>
-		<relativePath>../glide-module-parent/pom.xml</relativePath>
+		<relativePath>../glide-module-parent-z/pom.xml</relativePath>
 	</parent>
+
 	<artifactId>glide-cms</artifactId>
 	<name>Glide Content Management System and HomePage</name>
 	
diff --git a/glide-integrations/pom.xml b/glide-integrations/pom.xml
index 898423c..ccfb8c8 100644
--- a/glide-integrations/pom.xml
+++ b/glide-integrations/pom.xml
@@ -3,10 +3,11 @@
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>com.snc</groupId>
-		<artifactId>glide-module-parent</artifactId>
+		<artifactId>glide-module-parent-z</artifactId>
 		<version>5.0.0.0-SNAPSHOT</version>
-		<relativePath>../glide-module-parent/pom.xml</relativePath>
+		<relativePath>../glide-module-parent-z/pom.xml</relativePath>
 	</parent>
+
 	<artifactId>glide-integrations</artifactId>
 	<name>Glide Integrations</name>
 
diff --git a/glide-module-master-z/pom.xml b/glide-module-master-z/pom.xml
index d2ba79f..359d47b 100644
--- a/glide-module-master-z/pom.xml
+++ b/glide-module-master-z/pom.xml
@@ -9,12 +9,12 @@
 	</parent>
 
 	<artifactId>glide-module-master-z</artifactId>
-	<name>Master project for glide modules and services</name>
+	<name>Master Z project for glide modules and services</name>
 	<version>5.0.0.0-SNAPSHOT</version>
 	<packaging>pom</packaging>
 
 	<modules>
-		<module>../glide-module-parent</module>
+		<module>../glide-module-parent-z</module>
 
 		<!-- needs CMDB -->
 		<module>../glide-app-itbm</module>
diff --git a/glide-module-parent-z/pom.xml b/glide-module-parent-z/pom.xml
new file mode 100644
index 0000000..01b4f1b
--- /dev/null
+++ b/glide-module-parent-z/pom.xml
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>com.snc</groupId>
+		<artifactId>glide-build-bootstrap</artifactId>
+		<version>5.0.0.0</version>
+		<relativePath>../glide-build-bootstrap/pom.xml</relativePath>
+	</parent>
+
+	<artifactId>glide-module-parent-z</artifactId>
+	<name>Parent Z project for glide modules</name>
+	<version>5.0.0.0-SNAPSHOT</version>
+	<packaging>pom</packaging>
+
+	<properties>
+		<glide.version>5.0.0.0-SNAPSHOT</glide.version>
+		<app.cmdb.version>5.0.0.0-SNAPSHOT</app.cmdb.version>
+		<app.reporting.version>5.0.0.0-SNAPSHOT</app.reporting.version>
+
+		<!-- Test-related dependencies -->
+		<powermock.version>1.5</powermock.version>
+	</properties>
+
+	<dependencies>
+		<!-- All Glide services depend on Glide -->
+		<dependency>
+			<groupId>com.snc</groupId>
+			<artifactId>glide</artifactId>
+			<version>${glide.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.10</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>javax.servlet</groupId>
+				<artifactId>javax.servlet-api</artifactId>
+				<version>3.0.1</version>
+				<scope>provided</scope>
+			</dependency>
+			<dependency>
+				<!-- for glide-oauth -->
+				<groupId>org.bouncycastle</groupId>
+				<artifactId>bcmail-jdk15on</artifactId>
+				<version>1.50</version>
+			</dependency>
+			<dependency>
+				<!-- for glide-oauth -->
+				<groupId>org.bouncycastle</groupId>
+				<artifactId>bcprov-jdk15on</artifactId>
+				<version>1.50</version>
+			</dependency>
+			<dependency>
+				<!-- for glide-oauth -->
+				<groupId>org.bouncycastle</groupId>
+				<artifactId>bcpkix-jdk15on</artifactId>
+				<version>1.50</version>
+			</dependency>
+
+			<!-- FIXME: "Internal" dependencies -->
+			<dependency>
+				<groupId>com.snc</groupId>
+				<artifactId>glide-oauth</artifactId>
+				<version>${project.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.snc</groupId>
+				<artifactId>glide-paas</artifactId>
+				<version>${project.version}</version>
+			</dependency>
+			<dependency>
+				<groupId>com.snc</groupId>
+				<artifactId>glide-rest</artifactId>
+				<version>${project.version}</version>
+			</dependency>
+
+			<!-- Test-related dependencies -->
+			<dependency>
+				<groupId>org.hamcrest</groupId>
+				<artifactId>hamcrest-core</artifactId>
+				<version>1.3</version>
+			</dependency>
+			<dependency>
+				<groupId>org.hamcrest</groupId>
+				<artifactId>hamcrest-integration</artifactId>
+				<version>1.3</version>
+			</dependency>
+			<dependency>
+				<groupId>org.mockito</groupId>
+				<artifactId>mockito-core</artifactId>
+				<version>1.9.5</version>
+			</dependency>
+			<dependency>
+				<groupId>org.powermock</groupId>
+				<artifactId>powermock-module-junit4</artifactId>
+				<version>${powermock.version}</version>
+				<exclusions>
+					<exclusion>
+						<!-- Excluded as we bring in junit-dep -->
+						<groupId>junit</groupId>
+						<artifactId>junit</artifactId>
+					</exclusion>
+				</exclusions>
+			</dependency>
+			<dependency>
+				<groupId>org.powermock</groupId>
+				<artifactId>powermock-api-mockito</artifactId>
+				<version>${powermock.version}</version>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+	<build>
+		<resources>
+			<resource>
+				<directory>src/main/plugins</directory>
+				<targetPath>GLIDE-INF/plugins</targetPath>
+			</resource>
+		</resources>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<groupId>org.eclipse.m2e</groupId>
+					<artifactId>lifecycle-mapping</artifactId>
+					<version>1.0.0</version>
+					<configuration>
+						<lifecycleMappingMetadata>
+							<pluginExecutions>
+								<pluginExecution>
+									<pluginExecutionFilter>
+										<groupId>org.reflections</groupId>
+										<artifactId>reflections-maven</artifactId>
+										<versionRange>[0.9.8,)</versionRange>
+										<goals>
+											<goal>reflections</goal>
+										</goals>
+									</pluginExecutionFilter>
+									<action>
+										<execute>
+											<runOnIncremental>true</runOnIncremental>
+										</execute>
+										<ignore />
+									</action>
+								</pluginExecution>
+							</pluginExecutions>
+						</lifecycleMappingMetadata>
+					</configuration>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+
+		<plugins>
+			<plugin>
+				<groupId>org.reflections</groupId>
+				<artifactId>reflections-maven</artifactId>
+				<version>0.9.8</version>
+				<executions>
+					<execution>
+						<id>reflections-process-classes</id>
+						<goals>
+							<goal>reflections</goal>
+						</goals>
+						<phase>process-classes</phase>
+						<configuration>
+							<scanners>TypeAnnotationsScanner, SubTypesScanner, MethodAnnotationsScanner, FieldAnnotationsScanner</scanners>
+							<tests>false</tests>
+						</configuration>
+					</execution>
+					<execution>
+						<id>reflections-process-test-classes</id>
+						<goals>
+							<goal>reflections</goal>
+						</goals>
+						<phase>process-test-classes</phase>
+						<configuration>
+							<scanners>TypeAnnotationsScanner, SubTypesScanner, MethodAnnotationsScanner, FieldAnnotationsScanner</scanners>
+							<tests>true</tests>
+						</configuration>
+					</execution>
+				</executions>
+				<dependencies>
+					<dependency>
+						<groupId>org.reflections</groupId>
+						<artifactId>reflections</artifactId>
+						<version>0.9.8-snc9</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+		</plugins>
+	</build>
+
+	<!-- This is duplicated from snc-parent, but is needed to bootstrap development -->
+	<repositories>
+		<repository>
+			<id>stable</id>
+			<name>SNC Stable</name>
+			<url>https://release.devsnc.com/content/groups/stable</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+		</repository>
+	</repositories>
+
+</project>

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

only message in thread, other threads:[~2014-02-06 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-06 20:11 Rebase fail with new file Lee Carver

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.