All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Andy Whitcroft <apw@shadowen.org>, git@vger.kernel.org
Subject: Re: Pushing into a repository with working directory?
Date: Mon, 8 Jan 2007 22:32:13 -0500	[thread overview]
Message-ID: <20070109033213.GC1904@spearce.org> (raw)
In-Reply-To: <7vd55pt3ts.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
> However, I am not sure if that is easy to understand for the
> users.  It would be sane to deny pushing into the current branch
> for a non-bare repositories by default, and if we do allow it
> (perhaps with 'git-push --force'), then detach the HEAD as you
> suggest.  On the other hand, pushing into the current branch of
> a bare repository should just work; the HEAD pointer in a bare
> repository is not about the commit the index and the working
> tree are based on, but which branch is the primary branch of the
> repository.

But from the working directory management tools' perspective HEAD
*is* about the current index and the current working directory.
If HEAD doesn't match the index and working directory closely
enough then the user is going to do something stupid, like commit
a negative delta by accident.

Pushing into the current branch of a repository with a working
directory probably shouldn't be allowed by default as users probably
don't want to do that.  But if --force is used then detaching the
HEAD is probably the best idea.  The user could easily recover by
doing `git checkout origbranch` (though they may need `git checkout
-m origbranch` if their working directory was dirty).

-- 
Shawn.

  reply	other threads:[~2007-01-09  3:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-02  4:51 Pushing into a repository with working directory? Shawn O. Pearce
2007-01-05  8:51 ` Andy Whitcroft
2007-01-05  8:54   ` Junio C Hamano
2007-01-05  9:32     ` Andy Whitcroft
2007-01-05  9:50       ` Junio C Hamano
2007-01-05 19:36     ` Shawn O. Pearce
2007-01-08 13:53       ` Andy Whitcroft
2007-01-09  0:57         ` Junio C Hamano
2007-01-09  3:32           ` Shawn O. Pearce [this message]
2007-01-09  9:15             ` Andreas Ericsson
2007-01-09 13:51               ` Johannes Schindelin

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=20070109033213.GC1904@spearce.org \
    --to=spearce@spearce.org \
    --cc=apw@shadowen.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.