git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Alexander Mills <alexander.d.mills@gmail.com>
To: git@vger.kernel.org
Subject: git bug - merging JS / Node.js code with "git merge --squash"
Date: Wed, 14 Dec 2016 23:12:03 -0800	[thread overview]
Message-ID: <CA+KyZp4HzsSOghKZnKgXEXy_gqw-9oTHveDHn1eRUY-_C6_jww@mail.gmail.com> (raw)

@git-community

I am on Git git version 2.7.4

This problem is happening on Ubuntu 16.04, but the same problem was
also happening when I was running on MacOS.

I am consistently seeing merge bugs, when merging between branches of
a mostly Node.js project.
I am seeing fairly bad merges that mangle the code in ways that seem
to clearly show some sort of Git bug. Some of these merges were for
files where there was likely not even a diff between the files.
TBH I am no Git expert, but maybe I will learn something from this
investigation.

The latest example of a mangled file is here:
https://github.com/ORESoftware/suman/blob/staging/suman.conf.js

You can see some repeat code, and also there is a dangling brace which
means that the file won't even "compile" with Node.js, using "$ node
-c". Notice that this file was *not* a file where I recently  had to
manually merge code or manually fix a conflict, so I am hoping this is
not obvious operator error.

Here is the script I am using to merge between branches:
https://github.com/ORESoftware/suman/blob/dev/publish-suman.sh

basically it is doing the merge with this line:

git merge --squash -Xtheirs dev -m "squashing" &&

This is obviously very concerning because I can get very strange bugs
that I wouldn't expect, because I just assume that merges go well if
they succeed and it's hard to check for failure after that; even in a
compile statically typed language it could still prove difficult.

I am doing a check to make sure all my files compile with "node -c"
after the merge, but even then Git could create mangled code that
would still pass a "node -c" check.

Please let me know if this is a known bug and if there is a good
strategy to avoid it.

thanks!

-- 
Alexander D. Mills
(650)269-9502
alexander.d.mills@gmail.com

www.linkedin.com/pub/alexander-mills/b/7a5/418/

             reply	other threads:[~2016-12-15  7:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15  7:12 Alexander Mills [this message]
2016-12-15 18:10 ` git bug - merging JS / Node.js code with "git merge --squash" Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+KyZp4HzsSOghKZnKgXEXy_gqw-9oTHveDHn1eRUY-_C6_jww@mail.gmail.com \
    --to=alexander.d.mills@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).