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

Re: Pushing into a repository with working directory?

From
Andy Whitcroft <apw@shadowen.org>
Date
Jan 8, 2007, 13:53 UTC
Message-ID
<45A24CE6.5060201@shadowen.org>
In-Reply-To
<20070105193646.GC8753@spearce.org>
Shawn O. Pearce wrote:
Show 28 quoted lines
> Junio C Hamano <junkio@cox.net> wrote:
>> Andy Whitcroft <apw@shadowen.org> writes:
>>
>>> Special casing the 'current' branch makes any sort of automated push
>>> setup unreliable.  Indeed the special case preventing a fetch into the
>>> current branch is pretty annoying for the same reason.  I would almost
>>> prefer to relax that than add the same for push.
>> How would you relax the fetch case?  Fetching into the current
>> branch, unless the repository is bare, is always a fishy
>> operation.
> 
> And so is pushing into the current branch, so long as the current
> branch has a working directory attached to it.
> 
> Most new users to Git expect to be able to push into the current
> branch of a repository and `just have it work`.  Only they don't
> really seem to have an idea of _how_ that operation should behave,
> which means they really don't want it to work at all.  I certainly
> don't want an operation to succeed if I can't reason about what
> its success means!
> 
> Right now pushing into the current branch makes the index become
> way out of sync from HEAD.  This causes git-runstatus to display a
> large number of differences, basically undoing any of the changes
> introduced by HEAD@{1}..HEAD.  The user is left with a dirty
> working tree that they can commit - and committing it will just
> revert the prior commits.  The user will later cuss at Git for
> losing their changes.  Not pretty.

Ok, both seem to be bad. Can I re-ask if this would be solved by having the 'dangling head' support we talked about. Such that pulling into or pushing into the current head could break the link and make the current head a dangling head? In my mind thats very similar to creating a temporary branch for the user before updating the head they were on, but without having to actually make one.

-apw
Previous: Shawn O. PearceNext: Junio C Hamano
Message 7 of 11 in “Pushing into a repository with working directory?”
  1. Shawn O. PearceJan 2, 2007
  2. Andy WhitcroftJan 5, 2007
  3. Junio C HamanoJan 5, 2007
  4. Andy WhitcroftJan 5, 2007
  5. Junio C HamanoJan 5, 2007
  6. Shawn O. PearceJan 5, 2007
  7. Andy WhitcroftJan 8, 2007
  8. Junio C HamanoJan 9, 2007
  9. Shawn O. PearceJan 9, 2007
  10. Andreas EricssonJan 9, 2007
  11. Johannes SchindelinJan 9, 2007

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.