git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Possible git bug
@ 2021-09-16  3:29 Wesley Schwengle
  2021-09-16  5:37 ` Taylor Blau
  0 siblings, 1 reply; 25+ messages in thread
From: Wesley Schwengle @ 2021-09-16  3:29 UTC (permalink / raw)
  To: git


Hello,

I'm running into a weird issue with git at the moment and I'm wondering 
if this is a bug. I have a small reproduction path:

$ mkdir reproduction
$ cd reproduction
$ git init .
$ echo "commit a" > file.txt
$ git commit -m "First commit" file.txt
$ echo "commit b" >> file.txt
$ git commit -m "Second commit" file.txt

$ git switch -c foo
$ echo "commit c" >> file.txt"
$ git commit -m "Third commit" file.txt
$ git branch --set-upstream-to=master

$ git status
On branch foo
Your branch is ahead of 'master' by 1 commit.

$ git switch master
$ git merge foo
$ git reset --hard HEAD^
$ git switch foo
Switched to branch 'foo'
Your branch is ahead of 'master' by 1 commit.

$ git log --format='%C(yellow)%h%Creset %Cgreen%s%Creset'
5f427e3 Third commit
03ad791 Second commit
411e6d4 First commit

$ git rebase master
$ git status
On branch foo
Your branch is up to date with 'master'.

$ git log --format='%C(yellow)%h%Creset %Cgreen%s%Creset'
03ad791 Second commit
411e6d4 First commit

I do not expect to lose the commits from foo, it seems the ref of master 
doesn't get updated after a reset.

I didn't lose any work because I pushed my work to a remote and can 
still get it from there (and git reflog would also reach my code). It is 
rather surprising to see this kind of behavior.

I'm running:
$ git --version
git version 2.33.0.363.g4c719308ce

But I also got this behavior with the git shipped with Debian:
$ /usr/bin/git --version
git version 2.32.0

Cheers,
Wesley

-- 
Wesley Schwengle
E: wesley@schwengle.net

^ permalink raw reply	[flat|nested] 25+ messages in thread
* Possible git bug
@ 2013-08-14  4:50 Hugh Davenport
  2013-08-14  5:42 ` Daniel Knittl-Frank
  0 siblings, 1 reply; 25+ messages in thread
From: Hugh Davenport @ 2013-08-14  4:50 UTC (permalink / raw)
  To: git

Hey,

Not sure if this is a bug or not. I commonly am finding myself wanting 
to
remove some recent commits, either all or just a select few. So I use 
rebase
in interactive mode for this. The problem I find is that when I do a 
rebase
and leave no commits to pick (where I would think that this would do the 
same
as a reset --hard) just tells me that there is nothing to be done.

So would that be a bug? Or maybe a feature? I would like it that when 
you do
a rebase and select no commits, it will rebase ontop of the commit you 
chose,
and remove all the commits not shown in the interactive listing (so 
all).

Any ideas are welcome.

Cheers,

Hugh

^ permalink raw reply	[flat|nested] 25+ messages in thread
* Possible git bug
@ 2009-01-17 13:52 Damon LaCrosse
  2009-01-17 15:16 ` Johannes Schindelin
  0 siblings, 1 reply; 25+ messages in thread
From: Damon LaCrosse @ 2009-01-17 13:52 UTC (permalink / raw)
  To: git

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

HiQ,

any chances the attached patch reveals a git bug?

Cheers,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: git-bug.patch --]
[-- Type: text/x-patch, Size: 596 bytes --]

diff -Nru old/git-bug.sh new/git-bug.sh
--- old/git-bug.sh	1970-01-01 01:00:00.000000000 +0100
+++ new/git-bug.sh	2008-09-16 09:52:18.000000000 +0200
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+mkdir bug
+cd bug
+git init-db
+
+echo one > file1
+git add file1
+echo "Bug Test Example" | git commit --all -F -
+
+git checkout -b branch
+echo two >> file1
+echo "Branch modification" | git commit --all -F -
+
+git checkout master
+git mv file1 file2
+
+echo "Master rename" | git commit --all -F -
+
+echo three >> file2
+
+echo "Master modification" | git commit --all -F -
+
+git merge -s recursive branch

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

end of thread, other threads:[~2021-09-20 16:07 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16  3:29 Possible git bug Wesley Schwengle
2021-09-16  5:37 ` Taylor Blau
2021-09-16 12:07   ` Wesley Schwengle
2021-09-16 12:47     ` wesley
2021-09-16 12:47       ` [PATCH] Document `rebase.forkpoint` in rebase man page wesley
2021-09-16 15:43         ` Junio C Hamano
2021-09-16 21:21           ` Junio C Hamano
2021-09-16 22:35             ` Possible git bug wesley
2021-09-16 22:35               ` [PATCH] Document `rebase.forkpoint` in rebase man page wesley
2021-09-16 22:47                 ` Junio C Hamano
2021-09-16 22:50                   ` Wesley Schwengle
2021-09-16 22:53                     ` Junio C Hamano
2021-09-20 14:34                       ` Wesley Schwengle
2021-09-16 22:46             ` Possible git bug wesley
2021-09-16 22:46               ` [PATCH] Document `rebase.forkpoint` in rebase man page wesley
2021-09-20 16:07                 ` Junio C Hamano
2021-09-16 15:33       ` Possible git bug Junio C Hamano
2021-09-16 19:39         ` Wesley Schwengle
2021-09-16 21:52           ` Junio C Hamano
2021-09-16 22:30             ` Wesley Schwengle
  -- strict thread matches above, loose matches on Subject: below --
2013-08-14  4:50 Hugh Davenport
2013-08-14  5:42 ` Daniel Knittl-Frank
2013-08-14  6:53   ` Jeff King
2009-01-17 13:52 Damon LaCrosse
2009-01-17 15:16 ` Johannes Schindelin

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