git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* I just pulled, and git log --graph does not show all
@ 2019-09-24 10:22 Uwe Brauer
  2019-10-08 23:01 ` SZEDER Gábor
  0 siblings, 1 reply; 7+ messages in thread
From: Uwe Brauer @ 2019-09-24 10:22 UTC (permalink / raw)
  To: git




Hi 

I am confused, I just pulled 
but git log --graph --decorate
did not show all commits, 

Only 

git log --graph --decorate --all

 and from the emails I received the commits shown by --all

Should be on a new branch.

I confess I am a mercurial user not a git user, 

What is the reason for this behavior.

How can I now merge the new branch into master?

Thanks

Uwe Brauer 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: I just pulled, and git log --graph does not show all
  2019-09-24 10:22 I just pulled, and git log --graph does not show all Uwe Brauer
@ 2019-10-08 23:01 ` SZEDER Gábor
  2019-10-09  6:13   ` Uwe Brauer
  0 siblings, 1 reply; 7+ messages in thread
From: SZEDER Gábor @ 2019-10-08 23:01 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: git

On Tue, Sep 24, 2019 at 12:22:27PM +0200, Uwe Brauer wrote:
> I am confused, I just pulled 
> but git log --graph --decorate
> did not show all commits, 
> 
> Only 
> 
> git log --graph --decorate --all
> 
>  and from the emails I received the commits shown by --all
> 
> Should be on a new branch.
> 
> I confess I am a mercurial user not a git user, 
> 
> What is the reason for this behavior.
> 
> How can I now merge the new branch into master?

I hear you: I had a brief encounter with Mercurial not that long ago, 
and there were several things that didn't work the way I expected (or 
rather: the way I got used to with Git).  The subtle and sometimes
not-so-subtle differences between the concepts and philosophy of the
two systems might very well explain why Git didn't work the way you
expected.

However, it's impossible to give any explanation or advice without
knowing more about the situation, e.g. at least the exact commands
that you run and what they outputted, if you still have them or at
least if you can still reproduce the issue. (with potentially
sensitive URLs and/or branchnames redacted, if necessary).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: I just pulled, and git log --graph does not show all
  2019-10-08 23:01 ` SZEDER Gábor
@ 2019-10-09  6:13   ` Uwe Brauer
  2019-10-09 12:33     ` Derrick Stolee
  2019-10-09 13:23     ` SZEDER Gábor
  0 siblings, 2 replies; 7+ messages in thread
From: Uwe Brauer @ 2019-10-09  6:13 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Uwe Brauer, git

[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]


   > On Tue, Sep 24, 2019 at 12:22:27PM +0200, Uwe Brauer wrote:

   > I hear you: I had a brief encounter with Mercurial not that long ago, 
   > and there were several things that didn't work the way I expected (or 
   > rather: the way I got used to with Git).  The subtle and sometimes
   > not-so-subtle differences between the concepts and philosophy of the
   > two systems might very well explain why Git didn't work the way you
   > expected.

   > However, it's impossible to give any explanation or advice without
   > knowing more about the situation, e.g. at least the exact commands
   > that you run and what they outputted, if you still have them or at
   > least if you can still reproduce the issue. (with potentially
   > sensitive URLs and/or branchnames redacted, if necessary).

Thanks for your answer.

Could you please try out 
git clone https://git.code.sf.net/p/matlab-emacs/src matlab-emacs-hg

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

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.


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: I just pulled, and git log --graph does not show all
  2019-10-09  6:13   ` Uwe Brauer
@ 2019-10-09 12:33     ` Derrick Stolee
  2019-10-09 13:23     ` SZEDER Gábor
  1 sibling, 0 replies; 7+ messages in thread
From: Derrick Stolee @ 2019-10-09 12:33 UTC (permalink / raw)
  To: Uwe Brauer, SZEDER Gábor; +Cc: git

On 10/9/2019 2:13 AM, Uwe Brauer wrote:
> 
>    > On Tue, Sep 24, 2019 at 12:22:27PM +0200, Uwe Brauer wrote:
> 
>    > I hear you: I had a brief encounter with Mercurial not that long ago, 
>    > and there were several things that didn't work the way I expected (or 
>    > rather: the way I got used to with Git).  The subtle and sometimes
>    > not-so-subtle differences between the concepts and philosophy of the
>    > two systems might very well explain why Git didn't work the way you
>    > expected.
> 
>    > However, it's impossible to give any explanation or advice without
>    > knowing more about the situation, e.g. at least the exact commands
>    > that you run and what they outputted, if you still have them or at
>    > least if you can still reproduce the issue. (with potentially
>    > sensitive URLs and/or branchnames redacted, if necessary).
> 
> Thanks for your answer.
> 
> Could you please try out 
> git clone https://git.code.sf.net/p/matlab-emacs/src matlab-emacs-hg
> 
> 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
> 
> 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.

"git log --graph" has an implicit "HEAD" added on the end, to say
"start walking from my current commit". The "--all" says "walk from
all refs", so the set of commits to walk is larger.

"git log" defaults to showing history from your current position in
history, so you can look at the recent commits that you have created
or what changes led to your current state. Adding the "--all" gives
you a higher-level view of the repository, but can be very noisy
when trying to discover what has happened for your current state.

In particular, say you are trying to dig into a bug in Git 2.23.0.
A "git checkout v2.23.0" will change your HEAD to be at the commit
used to build that version. You can use "git log" to view the
history leading to that release, and see if you can determine recent
changes that would have caused a regression. If you use "git log --all",
then the commits in the "master" branch will appear before your
current HEAD, and you'll be looking at commits that "haven't happened
yet" according to your current place in history.

I hope this helps.

-Stolee


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: I just pulled, and git log --graph does not show all
  2019-10-09  6:13   ` Uwe Brauer
  2019-10-09 12:33     ` Derrick Stolee
@ 2019-10-09 13:23     ` SZEDER Gábor
  2019-10-09 13:36       ` Uwe Brauer
  2019-10-09 14:06       ` Uwe Brauer
  1 sibling, 2 replies; 7+ messages in thread
From: SZEDER Gábor @ 2019-10-09 13:23 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: git

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

> 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.

> 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'.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: I just pulled, and git log --graph does not show all
  2019-10-09 13:23     ` SZEDER Gábor
@ 2019-10-09 13:36       ` Uwe Brauer
  2019-10-09 14:06       ` Uwe Brauer
  1 sibling, 0 replies; 7+ messages in thread
From: Uwe Brauer @ 2019-10-09 13:36 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Uwe Brauer, git

[-- Attachment #1: Type: text/plain, Size: 3258 bytes --]

>>> "SG" == SZEDER Gábor <szeder.dev@gmail.com> writes:

   > 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':

Ok hg does the same, so I see the difference is in the git log --graph
command.


   >   $ git branch --all
   >   * master
   >     remotes/origin/HEAD -> origin/master
   >     remotes/origin/master
   >     remotes/origin/strings

   >> 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.

This is the difference, hg log -G always show all the commit starting
with tip (basically the same as HEAD), the behavior you described would
be 

  hg log -G --follow

   > As far as I can tell all Git commands above behave as they should.

   >> 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.

No I think the point is not the checkout the point is the  hg log -G
command.

I am now not so sure that really the strings branch/bookmark was checked
out I rather think not.

   > 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'.


As this is what I was looking for. I actually don't like fast forward,
so I would use the --no-ff option.

That was very helpful, thanks

Uwe 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: I just pulled, and git log --graph does not show all
  2019-10-09 13:23     ` SZEDER Gábor
  2019-10-09 13:36       ` Uwe Brauer
@ 2019-10-09 14:06       ` Uwe Brauer
  1 sibling, 0 replies; 7+ messages in thread
From: Uwe Brauer @ 2019-10-09 14:06 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Uwe Brauer, git

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]


   > 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'.

Interestingly enough it is impossible in mercurial to have a (not ff)
merge in mercurial in this situation, because you have only one head
(linear history) and two bookmarks. That is one thing I dislike in
mercurial, but it can be easily avoided by using named branches or
topics, but any way this is off topic.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-24 10:22 I just pulled, and git log --graph does not show all Uwe Brauer
2019-10-08 23:01 ` SZEDER Gábor
2019-10-09  6:13   ` Uwe Brauer
2019-10-09 12:33     ` Derrick Stolee
2019-10-09 13:23     ` SZEDER Gábor
2019-10-09 13:36       ` Uwe Brauer
2019-10-09 14:06       ` Uwe Brauer

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox