Skip to content

Instantly share code, notes, and snippets.

@Kjir
Last active September 25, 2018 19:05
Show Gist options
  • Save Kjir/8b3ad2e5d074fcf3b1459a18efd9fab6 to your computer and use it in GitHub Desktop.
Save Kjir/8b3ad2e5d074fcf3b1459a18efd9fab6 to your computer and use it in GitHub Desktop.
git rebase conflict on unrelated file
$ git --version
git version 2.19.0
$ git log --graph --oneline my-feat-2 master -6
* 4ce0262 (HEAD -> my-feat-2) SNS-558 chore: add sentry middleware to createSearchInquiry
| * dff2b2a (origin/master, origin/HEAD, master) Merge pull request #199 in HOM/sns from bugfix/same-recipient-for-e2e-test-makes-test-unstable to master
| * 06961b0 Merge pull request #196 in HOM/sns from bugfix/SNS-600-problems-removing-search-inquiries-from-Elastic-Search to master
| * 7dd576f Merge pull request #198 in HOM/sns from feature/SNS-584-saving-inactive-email-search-inquiry to master
|/
* 57eea5d Merge pull request #193 in HOM/sns from feature/SNS-571-add-component-test-to-match-listings to master
* 157cd1a SNS-584 feature: getting rid of unnecessary Promise.resolve(), better assertions for error cases in test
$ git diff 57eea5d..master --stat api # Changed files in master. The conflict will happen in the api directory.
api/createSearchInquiry/CreateSearchInquiry.ts | 32 ++++++++++++
api/createSearchInquiry/index.js | 25 ----------
api/createSearchInquiry/test/CreateSearchInquiry.spec.ts | 92 ++++++++++++++++++++++++++++++++++
api/handleAnalyticsLog/HandleAnalyticsLogs.ts | 13 +++++
api/handleAnalyticsLog/export/index.js | 8 ---
api/handleElasticsearchQuery/HandleElasticsearchQuery.ts | 92 ++++++++++++++++++++++++++++++++++
api/handleElasticsearchQuery/handleElasticsearchQuery.js | 57 ---------------------
api/handleElasticsearchQuery/index.js | 3 --
api/handleElasticsearchQuery/test/HandleElasticsearchQuery.spec.ts | 246 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
api/handleElasticsearchQuery/test/handleElasticsearchQuery.spec.ts | 204 --------------------------------------------------------------------------
api/handleListings/handleListings.ts | 3 +-
api/loadMatches/LoadMatches.ts | 2 +-
$ git diff 57eea5d..my-feat-2 --stat api
api/createSearchInquiry/index.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
$ git branch
master
* my-feat-2
$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: SNS-558 chore: add sentry middleware to createSearchInquiry
Using index info to reconstruct a base tree...
A api/createSearchInquiry/index.js
Falling back to patching base and 3-way merge...
Auto-merging api/getSearchInquiries/index.js
CONFLICT (content): Merge conflict in api/getSearchInquiries/index.js
error: Failed to merge in the changes.
Patch failed at 0001 SNS-558 chore: add sentry middleware to createSearchInquiry
hint: Use 'git am --show-current-patch' to see the failed patch
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
$ git status
rebase in progress; onto dff2b2a
You are currently rebasing branch 'my-feat-2' on 'dff2b2a'.
(fix conflicts and then run "git rebase --continue")
(use "git rebase --skip" to skip this patch)
(use "git rebase --abort" to check out the original branch)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: infrastructure/cloudformation-dsl/src/Sn/yaml/resources/createSearchInquiry.yml
new file: middleware/sentryMiddleware.js
modified: package.json
modified: util/promise/PromiseUtils.js
modified: yarn.lock
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: api/getSearchInquiries/index.js <=============== THIS IS THE WRONG FILE!!!
$ git diff
diff --git a/api/getSearchInquiries/index.js b/api/getSearchInquiries/index.js
index 5f66404..01c5c1e 100644
--- a/api/getSearchInquiries/index.js
+++ b/api/getSearchInquiries/index.js
@@ -1,10 +1,18 @@
const AWS = require('aws-sdk');
+const middy = require('middy');
+
+const SentryMiddleware = require('../../middleware/sentryMiddleware');
const { SearchInquiry, SearchInquiryKeyMapper } = require('../../domain/searchInquiry');
const Response = require('../response');
const { COMPONENT_TYPE, LoggerFactory } = require('../../util/logger');
+<<<<<<< HEAD:api/getSearchInquiries/index.js
module.exports.getSearchInquiries = (event, context, callback) => {
const logger = LoggerFactory.createGenericLogger(COMPONENT_TYPE.GET_SEARCH_INQS_API);
+=======
+const handler = (event, context, callback) => {
+ const logger = LoggerFactory.createGenericLogger(COMPONENT_TYPE.CREATE_SEARCH_INQ_API);
+>>>>>>> SNS-558 chore: add sentry middleware to createSearchInquiry:api/createSearchInquiry/index.js
logger.debug(JSON.stringify(event));
logger.debug(JSON.stringify(context));
@@ -19,3 +27,5 @@ module.exports.getSearchInquiries = (event, context, callback) => {
.then(response => callback(null, Response.getOkResponse(response)))
.catch(() => callback(null, Response.getErrorResponse()));
};
+
+module.exports.createSearchInquiry = middy(handler).use(SentryMiddleware());
### This diff is mixture between the two files ###
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment