Skip to content

a commit disappears from change history of a branch #3704

Closed

Description

@vincent3569

Description

I have a repositoty (https://github.com/vincent3569/zenphoto-perso) that is a fork from another repo (https://github.com/zenphoto/zenphoto)

In my repo, I have 2 branchs (master and perso).
in perso branch, I added a personnal dev
in master branch, I updated some translations and I made a pull request to the initial repo.

after that
I merge master branch into perso branch (so I have all commits of my new feature + my translations update)

after the pull request has been merged into upstream/master,
I want to keep my fork sync with upstream (although it seems to be useless since my repo is up to date because I am at the initiative of the changes).

on my_repo/master I made a "merge into current branch" from upstream/master.
and on my_repo/perso I made a "merge into current branch" from master.

after that, my personnal commit on my_repo/perso desapears from changes history of this branch.
I still see it on github.

Version

GitHub Desktop version: [github desktop 1.0.12-beta0]

OS version: [Microsoft Windows 10.0.16299.125]

Steps to Reproduce

See above

Logs

2017-07-31.desktop.production.log

Additional Information

screenshots of github desktop

zenphoto -- master
zenphoto-perso -- master
zenphoto-perso -- perso
zenphoto-perso -- perso on github
zenphoto-perso -- master on github

Activity

  1. vincent3569 commented on Dec 31, 2017

    @vincent3569
    Author

    and other facts:
    If I try to merge perso branch in master branch, gitub destkop tells me there are 3 commits to bring in master (I didn't commited so far to see what are these commits - especially my new feature)

    capture

    on github, if I rename my fork (ie https://github.com/vincent3569/zenphoto-dev)
    when I go to github desktop, after fetch/syn, I can see the commit
    and if I use the 1rst name again (https://github.com/vincent3569/zenphoto-perso), I loose it again.

    the screenshots
    capture1
    capture2

    and my today's logs
    2017-12-31.desktop.beta.log
    2017-07-31.desktop.production.log

  2. changed the title [-]a commit desapears from change history of a branch[/-] [+]a commit disappears from change history of a branch[/+] on Jan 2, 2018
  3. added
    investigation-needed
    on Jan 3, 2018
  4. vincent3569 commented on Jan 10, 2018

    @vincent3569
    Author

    not clear for me:
    you need me to reproduce the issue? or you have to reproduce it yourself?

  5. iAmWillShepherd commented on Jan 10, 2018

    @iAmWillShepherd
    Contributor

    @vincent3569 that label is for us, so we don't need anything more from you at the moment. But, keep an eye on this issue in case we do need more info.

  6. shiftkey commented on Jan 10, 2018

    @shiftkey
    Member

    @vincent3569 what @iAmWillShepherd said. I think all the details are there, it's just the steps through are tricky to understand.

    One additional thing you could do for me is to run this command inside each repository that you're troubleshooting:

    $ git log --graph --oneline
    

    This will show a better visual representation of the repository, to help me understand the commit that you're missing.

    For example, I ran this on master in vincent3569/zenphoto-perso:

    ~/src/test/zenphoto-perso/ git log --graph --oneline
    *   ad806e28 Merge pull request #1121 from vincent3569/master
    |\
    | * 407b490a update french translations
    |/
    * 316514f2 Show note in admintoolbox if site status is "closed for testing" fix #1120
    * 26e04786 Small text addition to last pull request/commit as manual pagebreak is not exactly tinyMCE dependent.
    *   664c4fac Merge pull request #1119 from vincent3569/master
    |\
    | * 76b435ed more for https://github.com/zenphoto/zenphoto/issues/1116
    |/
    * a4cdd5d0 Revert: Again use htmlawed as fallback only if native php tidy extension is not available #1116
    * 928c6812 Fix undeclared global js variables required by admin toolbox for delete links. First part of #1118
    *   fc8c810a Merge pull request #1117 from vincent3569/master
    |\
    | * 631d3f5f fix rel attribute on <a> tag
    |/
    * f11faf98 Use htmlawed for "reparing" broken html only
    * a90066fc Finally add accidentally forgotten file…
    ...
    

    And I ran this on the perso branch on vincent3569/zenphoto-perso:

    ~/src/test/zenphoto-perso/ git log --graph --oneline
    *   b9455336 Merge branch 'master' into perso
    |\
    | *   ad806e28 Merge pull request #1121 from vincent3569/master
    | |\
    * | \   b2d89737 Merge branch 'master' into perso
    |\ \ \
    | | |/
    | |/|
    | * | 407b490a update french translations
    | |/
    * | e580c96d new feature
    |/
    * 316514f2 Show note in admintoolbox if site status is "closed for testing" fix #1120
    * 26e04786 Small text addition to last pull request/commit as manual pagebreak is not exactly tinyMCE dependent.
    *   664c4fac Merge pull request #1119 from vincent3569/master
    |\
    | * 76b435ed more for https://github.com/zenphoto/zenphoto/issues/1116
    |/
    * a4cdd5d0 Revert: Again use htmlawed as fallback only if native php tidy extension is not available #1116
    * 928c6812 Fix undeclared global js variables required by admin toolbox for delete links. First part of #1118
    *   fc8c810a Merge pull request #1117 from vincent3569/master
    |\
    | * 631d3f5f fix rel attribute on <a> tag
    |/
    

    It's the new feature commit that you're not seeing sometimes in the repository, correct?

    ~/src/test/zenphoto-perso/ git show e580c96d
    commit e580c96d4939aa6b3796d3897da699c260e4d20e
    Author: vincent3569 <[email protected]>
    Date:   Sat Dec 30 22:43:47 2017 +0100
    
        new feature
    
        navigate between single news within category
        https://github.com/zenphoto/zenphoto/issues/1087
    
    diff --git a/zp-core/zp-extensions/zenpage.php b/zp-core/zp-extensions/zenpage.php
    index 94b3bfd6..0c513076 100644
    ...
    

    If that's the case, we can then look into how Desktop is getting that data and see why it's not showing that commit. I don't think renaming of the repository is the issue here, but I'll keep that in mind.

  7. self-assigned this
    on Jan 10, 2018
  8. vincent3569 commented on Jan 10, 2018

    @vincent3569
    Author

    yes this is this e580c96d commit that disappears.

    I ran your commande on my folder from master branch:

    GitHub\zenphoto-perso>git log --graph --oneline
    *   ad806e28 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #1121 from vincent3569/master
    |\
    | * 407b490a update french translations
    |/
    * 316514f2 Show note in admintoolbox if site status is "closed for testing" fix #1120
    * 26e04786 Small text addition to last pull request/commit as manual pagebreak is not exactly tinyMCE dependent.
    *   664c4fac Merge pull request #1119 from vincent3569/master
    |\
    | * 76b435ed more for https://github.com/zenphoto/zenphoto/issues/1116
    |/
    * a4cdd5d0 Revert: Again use htmlawed as fallback only if native php tidy extension is not available #1116
    * 928c6812 Fix undeclared global js variables required by admin toolbox for delete links. First part of #1118
    *   fc8c810a Merge pull request #1117 from vincent3569/master
    |\
    | * 631d3f5f fix rel attribute on <a> tag
    |/
    * f11faf98 Use htmlawed for "reparing" broken html only
    

    I ran your commande on my folder from perso branch:

    GitHub\zenphoto-perso>git log --graph --oneline
    *   b9455336 (HEAD -> perso, origin/perso) Merge branch 'master' into perso
    |\
    | *   ad806e28 (origin/master, origin/HEAD, master) Merge pull request #1121 from vincent3569/master
    | |\
    * | \   b2d89737 Merge branch 'master' into perso
    |\ \ \
    | | |/
    | |/|
    | * | 407b490a update french translations
    | |/
    * | e580c96d new feature
    |/
    * 316514f2 Show note in admintoolbox if site status is "closed for testing" fix #1120
    * 26e04786 Small text addition to last pull request/commit as manual pagebreak is not exactly tinyMCE dependent.
    *   664c4fac Merge pull request #1119 from vincent3569/master
    |\
    | * 76b435ed more for https://github.com/zenphoto/zenphoto/issues/1116
    |/
    * a4cdd5d0 Revert: Again use htmlawed as fallback only if native php tidy extension is not available #1116
    * 928c6812 Fix undeclared global js variables required by admin toolbox for delete links. First part of #1118
    *   fc8c810a Merge pull request #1117 from vincent3569/master
    |\
    | * 631d3f5f fix rel attribute on <a> tag
    |/
    * f11faf98 Use htmlawed for "reparing" broken html only
    

    I have something else new:
    I am now with GitHub Desktop version: [github desktop 1.0.12-beta1]

    When I go to perso branch for the 1st time, I can see the commit.
    If I switch to master branch and return to perso branch , the commit disappears

    the screenshots:

    capture1

    capture2

  9. ttsanton commented on Jan 29, 2018

    @ttsanton

    Hello,

    I believe this issue is happening to me as well. I'm running GitHub Desktop ver. 1.0.12 on Mac OS High Sierra 10.13.2

    I committed some changes on a dev branch I created. A few days later, I merged changes from the master onto my dev branch. However, the changes I made before don't show up anymore on the History tab of GitHub Desktop, but I can view the changes on GitHub.com and within my IDE when I switch between the master and dev branch using GitHub Desktop.

    Screenshots below.

    GitHub Desktop not showing the Jan 23 and Jan 25 commits:
    screen shot 2018-01-29 at 10 39 33 am

    GitHub.com showing the Jan 23 and Jan 25 commits:
    screen shot 2018-01-29 at 10 41 20 am

  10. removed their assignment
    on Feb 1, 2018
  11. shiftkey commented on Feb 2, 2018

    @shiftkey
    Member

    @vincent3569 @ttsanton I've been able to reproduce this using the zenphoto-perso fork, and switching between master and perso.

    • The first time you view the perso branch, the problem commit e580c96d is in the history
    • Then, you switch to master and the commit is gone (this is expected)
    • Switching back to person, it appears to be rendering the history but it omits the e580c96d commit

    I think this is related to how we're rendering the history, rather than the name of the repository. I need to throw more tracing around this to understand how it's broken.

  12. self-assigned this
    on Feb 2, 2018
  13. added
    bug
    and removed
    investigation-needed
    on Feb 2, 2018
  14. shiftkey commented on Feb 2, 2018

    @shiftkey
    Member

    Alright, I know the root cause but still haven't figured out a solution.

    When switching branches, we try and merge the current history with the new history:

    const mostRecent = existingHistory[0]
    const index = commits.findIndex(c => c.sha === mostRecent)
    // If we found the old HEAD, then we can just splice the new commits into
    // the history we already loaded.
    //
    // But if we didn't, it means the history we had and the history we just
    // loaded have diverged significantly or in some non-trivial way
    // (e.g., HEAD reset). So just throw it out and we'll start over fresh.
    if (index > -1) {
    commits = commits.slice(0, index)
    } else {
    existingHistory = []
    }

    This however seems to break in cases where you've merged master into your development branch, as the app sees the newer commit already cached and won't apply the right steps to unify the two histories (it ignores older history).

    We do this because clearing the list introduces some visual problems:

    • the virtualized list flickers when being cleared and repopulated
    • the selected commit is lost (and I think it reverts to the first commit)

    For reference, we addressed an issue with history getting out of sync when pulling from the remote #3541, but I don't think I can apply the same fix here (the merge base of master and your dev branch are after the missing commit).

  15. removed their assignment
    on Feb 7, 2018
  16. tablatronix commented on Apr 4, 2018

    @tablatronix

    same issue here missing all commits around a specific date and from a merged deleted branch, not sure which broke it, I did some cherry picking and a merge, looking at graphs now to see what the deal is.

    But this resolves after a restart, odd bug, I won't provide data, my history way to convoluted to even help identify anything. :(

  17. added
    priority-3
    on Oct 11, 2018
  18. bryanmyers commented on Jan 28, 2021

    @bryanmyers

    Me too. GitHub Desktop version 2.6.2 MacOS 10.14.6 github webpage vs desktop. Merge branch 361... doesn't show up. which is a shame since I need to undo that commit.

    github website:
    Screen Shot 2021-01-28 at 9 04 34 AM

    github desktop:
    Screen Shot 2021-01-28 at 9 04 46 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions