TLDR;
- On
master
branch thediscourse
section was removed - On
dev
branch thefddkim
section was removed dev
branch is being rebased on top ofmaster
- A merge conflict happened
I am looking for an option which can do the next in this situation:
- See from diff between ‘HEAD’ and ‘parent’ that
discourse
section was deleted. - Apply this removal to
>>>>>>> 50fc8707
- If no conflicts occurs for previous step, resolve merge conflict automatically
or, at least, ask interactively to confirm suggested resolution with simpleyes/no
.
Is there a git option for a such strategy to resolve merge conflict automatically?
My apologies for a long post details, but merge conflicts were never simple.
git diff
for this situation it is pretty unreadable and wrong:
- Git tells that the next lines was removed
-resource "aws_route53_record" "xxx-files_CNAME"
-name = "files.xxx.com."
-ghs.googlehosted.com.
- Git readds those lines after
>>>>>>>>
git version 2.43.0
We can see that files
section was untouched, if the file is opened in an editor:
resource "aws_route53_record" "xxx-calendar_CNAME" {
zone_id = aws_route53_zone.xxx.zone_id
name = "calendar.xxx.com."
type = "CNAME"
records = [
"ghs.googlehosted.com.",
]
ttl = 3600
}
<<<<<<< HEAD
resource "aws_route53_record" "xxx-fddkim_CNAME" {
zone_id = aws_route53_zone.xxx.zone_id
name = "fddkim.xxx.com."
type = "CNAME"
records = [
"spfmx.domainkey.freshdesk.com.",
]
ttl = 3600
}
||||||| parent of 50fc8707 (Removed DNS RRs which authorized FreshDesk to send emails on our behalf)
resource "aws_route53_record" "xxx-discourse_A" {
zone_id = aws_route53_zone.xxx.zone_id
name = "discourse.xxx.com."
type = "A"
records = [
"1.2.3.4",
]
ttl = 3600
}
resource "aws_route53_record" "xxx-fddkim_CNAME" {
zone_id = aws_route53_zone.xxx.zone_id
name = "fddkim.xxx.com."
type = "CNAME"
records = [
"spfmx.domainkey.freshdesk.com.",
]
ttl = 3600
}
=======
resource "aws_route53_record" "xxx-discourse_A" {
zone_id = aws_route53_zone.xxx.zone_id
name = "discourse.xxx.com."
type = "A"
records = [
"1.2.3.4",
]
ttl = 3600
}
>>>>>>> 50fc8707 (Removed DNS RRs which authorized FreshDesk to send emails on our behalf)
resource "aws_route53_record" "xxx-files_CNAME" {
zone_id = aws_route53_zone.xxx.zone_id
name = "files.xxx."
type = "CNAME"
records = [
"ghs.googlehosted.com.",
]
ttl = 3600
}
From the diff above we can see that:
- the section for
files
subdomain was not touched at all. - the section
discourse
was removed inmaster
branch - the parent has both
discourse
andfddkim
sections - the section
fddkim
was removed indev
branch
Here the diffs for removals:
@@ -299,16 +299,6 @@ resource "aws_route53_record" "xxx-cal>
ttl = 3600
}
-resource "aws_route53_record" "xxx-discourse_A" {
- zone_id = aws_route53_zone.xxx.zone_id
- name = "discourse.xxx.com."
- type = "A"
- records = [
- "45.55.79.151",
- ]
- ttl = 3600
-}
-
resource "aws_route53_record" "xxx-fddkim_CNAME" {
zone_id = aws_route53_zone.xxx.zone_id
name = "fddkim.xxx.com."
@@ -309,16 +277,6 @@ resource "aws_route53_record" "xxx-dis>
ttl = 3600
}
-resource "aws_route53_record" "xxx-fddkim_CNAME" {
- zone_id = aws_route53_zone.xxx.zone_id
- name = "fddkim.xxx.com."
- type = "CNAME"
- records = [
- "spfmx.domainkey.freshdesk.com.",
- ]
- ttl = 3600
-}
-
resource "aws_route53_record" "xxx-files_CNAME" {
zone_id = aws_route53_zone.xxx.zone_id
name = "files.xxx.com."
PS. It would be nice to know the option which will instruct git to do section groping, instead of line-by-line (yeah, I know, some lines are duplicated, but it is easier to read/understand the output):
@@@ -299,16 -267,16 +267,6 @@@ resource "aws_route53_record" "xxx>
ttl = 3600
}
- resource "aws_route53_record" "xxx-fddkim_CNAME" {
-- zone_id = aws_route53_zone.xxx.zone_id
- name = "fddkim.xxx.com."
- type = "CNAME"
-- records = [
- "spfmx.domainkey.freshdesk.com.",
-- ]
-- ttl = 3600
--}
--
---VS
-resource "aws_route53_record" "xxx-discourse_A" {
-- zone_id = aws_route53_zone.xxx.zone_id
- name = "discourse.xxx.com."
- type = "A"
-- records = [
- "1.2.3.4",
-- ]
-- ttl = 3600
--}
--
resource "aws_route53_record" "xxx-files_CNAME" {
zone_id = aws_route53_zone.xxx.zone_id
name = "files.xxx.com."
Instead of this:
@@@ -299,16 -267,16 +267,6 @@@ resource "aws_route53_record" "xxx>
ttl = 3600
}
- resource "aws_route53_record" "xxx-fddkim_CNAME" {
-resource "aws_route53_record" "xxx-discourse_A" {
-- zone_id = aws_route53_zone.xxx.zone_id
- name = "fddkim.xxx.com."
- type = "CNAME"
- name = "discourse.xxx.com."
- type = "A"
-- records = [
- "spfmx.domainkey.freshdesk.com.",
- "1.2.3.4",
-- ]
-- ttl = 3600
--}
--
resource "aws_route53_record" "xxx-files_CNAME" {
zone_id = aws_route53_zone.xxx.zone_id
name = "files.xxx.com."