git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin von Zweigbergk <martinvonz@gmail.com>
To: git@vger.kernel.org
Subject: Operations on unborn branch
Date: Tue, 27 Nov 2012 09:25:52 -0800	[thread overview]
Message-ID: <CANiSa6isDKAgxHWqh5XiQ-adT3-ASFtvAshp028DTcotjQxzmQ@mail.gmail.com> (raw)

While looking at how to handle "git rebase --root", I noticed that
"git cherry-pick" fails with the following when run on an unborn
branch:

error: You do not have a valid HEAD
fatal: cherry-pick failed

I can not see any reason that it shouldn't work. "git cherry-pick -n"
does work. (For rebase, "git cherry-pick --ff" would be used, and I
think that should also work on an unborn branch.)

Also, "git reset" doesn't work on an unborn branch and I can not see
any reason that it shouldn't work. This was also asked on stack
overflow [1], and of course the solution is to use "git rm --cached",
but doesn't mean that "git reset" shouldn't work.

I have very limited time to work on git these days, so if anyone else
would like to work on any of this, I would be very happy. I _might_
take some time to fix the cherry-pick issue.

Btw, every time I run into problems like these with the treatment of
root commits, I can't help but wonder how things would look if git had
always had a single root commit (naturally with some dummy user,
timestamp etc to ensure sameness across repos). With my limited
knowledge, it seems like that would complicate a few things, but
simplify a lot of things (maybe I'm biased because of the things I
have happened to work on?). Has anyone spent some time seriously
thinking about this? I suppose it would be hard to introduce
backward-compatibly, and maybe this is very unrealistic even for git
2.0, but I would be curious to hear what others think.

Martin

[1] http://stackoverflow.com/questions/3894808/new-git-repository-and-already-git-reset-does-not-work

             reply	other threads:[~2012-11-27 17:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 17:25 Martin von Zweigbergk [this message]
2012-11-27 20:25 ` Operations on unborn branch Junio C Hamano
2012-11-27 20:39   ` Martin von Zweigbergk
2012-11-28  7:12     ` Junio C Hamano
2012-11-30 16:39       ` Martin von Zweigbergk
2012-11-29 18:32 ` [RFC/PATCH 0/2] Fix "git reset" " Martin von Zweigbergk
2012-11-29 18:32   ` [RFC/PATCH 1/2] reset: learn to reset to tree Martin von Zweigbergk
2012-11-29 18:47     ` Junio C Hamano
2012-11-29 19:04       ` Martin von Zweigbergk
2012-11-29 19:36         ` Junio C Hamano
2012-11-29 19:13       ` Junio C Hamano
2012-11-29 22:00         ` Martin von Zweigbergk
2012-11-30 16:45           ` Martin von Zweigbergk
2012-12-01  9:24             ` Junio C Hamano
2012-12-05  3:45               ` Martin von Zweigbergk
2012-12-05  5:46                 ` Junio C Hamano
2012-12-05 12:58                   ` Martin von Zweigbergk
2012-11-29 18:32   ` [RFC/PATCH 2/2] reset: learn to reset on unborn branch Martin von Zweigbergk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANiSa6isDKAgxHWqh5XiQ-adT3-ASFtvAshp028DTcotjQxzmQ@mail.gmail.com \
    --to=martinvonz@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).