Re: git bug(?) for commit baf18fc261ca475343fe3cb9cd2c0dded4bc1bb7
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Nov 7, 2011, 09:30 UTC
- Message-ID
- <CACsJy8C25qurZwTLuuZ8X4EUzg-NP_qwFjcPTZoEs7QOOS-WBA@mail.gmail.com>
- In-Reply-To
- <BC404302028E4B6F8F2C27DC8E63545F@gmail.com>
Hi,
On Mon, Nov 7, 2011 at 3:59 PM, Tony Wang <wwwjfy@gmail.com> wrote:
> Hi, > I don't know if a better way to report this, so I write to the author of the > commit. Please let me know if I do wrong. :)
It's good that you bisect to the broken commit and send me. However you should always send to git@vger just in case I'm unavailable.
Show 6 quoted lines
> The thing is the commit baf18fc261ca475343fe3cb9cd2c0dded4bc1bb7 made an > option broken sometimes (it's weird, but it's true that it didn't happen > every time) > I set "branch.master.mergeoptions=--squash" in config, but when I do "git > merge b", the squash didn't work, however, "git merge b --squash" works as > expected.
What was the expection? --squash was not effective or something else?
Show 6 quoted lines
> I tried to debug, and found after this > merge.c:1104 > head_commit = lookup_commit_or_die(head_sha1, "HEAD"); > the variable branch becomes "s/origin/b", which is previously "b". > I used git bisect and found the > commit baf18fc261ca475343fe3cb9cd2c0dded4bc1bb7 caused this.
Variable "head_sha1"? Strange because lookup_commit_or_die() takes "const char *" and the compiler should catch any attempts to change the variable.
If you can reproduce it, can you make a small test case to demonstrate it? I'm not sure what "b" is and how you set up configuration for branch master. BTW what git version did you use?
> I browsed the diff, and found the function lookup_commit_or_die > uses lookup_commit_reference, but not lookup_commit which was used > before lookup_commit_or_die replaced it. > Was it on purpose or typo?
It was on purpose. HEAD may contain a tag, in which case lookup_commit() would to return a commit fail while lookup_commit_reference() can peel the tag to the commit.
> If possible, it'll be good that I can know some details. > Thanks!
-- Duy