git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: I just pulled, and git log --graph does not show all

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Oct 9, 2019, 13:23 UTC
Message-ID
<20191009132345.GH29845@szeder.dev>
In-Reply-To
<871rvmsaxn.fsf@mat.ucm.es>
On Wed, Oct 09, 2019 at 09:13:56AM +0300, Uwe Brauer wrote:
> Could you please try out 
> git clone https://git.code.sf.net/p/matlab-emacs/src matlab-emacs-hg

This repository contains two branches: 'master' and 'strings'. From these two 'master' is the default branch, so that is that 'git clone' will check out for you; note the '*' in front of 'master':

  $ git branch --all
  * master
    remotes/origin/HEAD -> origin/master
    remotes/origin/master
    remotes/origin/strings
Show 12 quoted lines
> Then you will see
> 
> That 
> git log --graph
> and
> 
> git log --graph --all
> 
> Are giving two different results and I don't understand why the branch
> is not shown when using 
> 
> git log --graph

Without any ref parameter 'git log' shows the history starting at the currently checked out commit (in this respect it behaves the same way as 'hg log'), so it only shows the history of 'master'. 'git log --all' means "show the history of all refs in the repository", so it shows the history of the remote branch 'strings' as well.

As far as I can tell all Git commands above behave as they should.
Show 5 quoted lines
> Funny thing is when I use the hg-git plugin and run 
> 
> hg clone https://git.code.sf.net/p/matlab-emacs/src matlab-emacs-hg
> 
> I see this branch, converted to a hg bookmark.

For some reason after cloning that repository with Mercurial and its hg-git plugin it checks out the 'strings' branch:

  $ hg bookmarks 
     master                    170:6c03da83e522
   * strings                   195:b2396f3ceca3

Consequently, when you run 'hg log' without a branch/bookmark/whatever parameter it shows the history of the 'strings' branch.

I'm not sure what to think about 'hg clone' checking out a branch other than the default branch. In Git this would definitely be a bug. In Mercurial, I don't know; given my limited experience I don't want to outright call it a bug. I think it would be worth reporting it to the 'hg-git' project.

Anyway, in your first email you asked how you can merge that branch into 'master'. The command 'git merge origin/strings' will "merge" it without actually creating a merge commit, because 'strings' builds entirely on top of 'master'; this is what Git calls a "fast-forward merge". If you do want a merge commit, then run 'git merge --no-ff origin/strings'.

Previous: Derrick StoleeNext: Uwe Brauer
Message 5 of 7 in “I just pulled, and git log --graph does not show all”
  1. Uwe BrauerSep 24, 2019
  2. SZEDER GáborOct 8, 2019
  3. Uwe BrauerOct 9, 2019
  4. Derrick StoleeOct 9, 2019
  5. SZEDER GáborOct 9, 2019
  6. Uwe BrauerOct 9, 2019
  7. Uwe BrauerOct 9, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.