git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rich Pixley <rich.pixley@palm.com>
To: Seth Robertson <in-gitvger@baka.org>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Newbie grief
Date: Mon, 30 Apr 2012 20:04:25 -0700	[thread overview]
Message-ID: <4F9F52B9.9060508@palm.com> (raw)
In-Reply-To: <201205010137.q411bxaU002449@no.baka.org>

On 4/30/12 18:37 , Seth Robertson wrote:
> For example, in the diagram http://mercurial.selenic.com/wiki/Head
> rev2 might be your version of master and rev3 might be my version.
> Both might exist in my repository and both might exist in your
> repository, and both might have the symbolic name "master" associated
> with it, and git would keep it entirely straight.

But not in the same repository. And therein lies the issue.

>      >     What git *does* forbid
>      >  (by default) is:
>      >
>      >  1: Letting you update someone else's checked out (non-bare) repository
>      >  underneath them
>      Yeah.  That "underneath them" thing is confusing.  I don't see any
>      reason why that should necessarily be so.
>
>      Git knows what commit is checked out.  That's HEAD, yes?  So what's
>      wrong with letting it collect other commits from other repositories
>      while your working directory sits?
>
> It does!  It can!

To the branch you have checked out?  That's what I want!  How do I do that?

> What is forbidden is for me update what you have
> checked out.

There's some ambiguity in your sentence here.  I don't know whether 
you're referring to my being forbidden from modifying your working 
directory or whether you're referring my being forbidden to modify the 
branch from which your working directory is checked out.  I understand 
and respect the former, but the latter seems arbitrary.

(I think clearcase already answered the dynamic update problem.  I liked 
it.  And I especially liked clearmake and build avoidance.  Shame that 
IBM killed it.  (Oh, and if you had inconsistent builds, then you 
weren't using clearmake.  Clearmake solved that problem.))

I'm less concerned about whether my push changes your working directory. 
  I'm fine with leaving your working directory as is and letting you 
decide when and how to move forward on your own time.

Perhaps part of the problem here is the unfortunate choice of the word 
"HEAD" to refer to the thing you have checked out when that commit might 
not be a childless commit at all.  When I say "create another head" I 
mean, "create a childless commit on the same branch".

>      You can always commit your change right on top of what's checked
>      out, creating a second head for that branch.
>
> With git, you must always commit your change right on top of what's
> checked out, though of course you may decide to change what's checked
> out and "float" the changes you made over to the new head (trivial, as
> long as there are not conflicts between the two heads and the changes
> you made).  However, only the user of the repository is allowed to do
> this.  A remote user is not allowed to change what's checked out.

Ok, how do I ask git to push a commit into the middle of a branch that 
you have checked out at a tip, (there's always exactly one tip for any 
branch in git, right?)?  I don't care to change your working directory 
nor your index.  I just want my commits to show up in the middle of that 
branch.

>      Yes, I've read that git-diff, etc, are all making assumptions that fail
>      in this case, but there's nothing significantly different about
>      collecting commits to other branches and collecting commits to the
>      branch you're currently checked out from.
>
> Yes there is.  Consider this use case.  You can I both spot DIFFERENT
> bugs.  You and I both start editing filea.  I fix my problem one way
> which involves lines 10, 100, and 500, you fix your problem which
> involves line 10, 100, and 200.  I'm typing faster than you so I
> commit/push first.  If I can update your HEAD, at that point I've
> changed the file you are editing. You save and my change is lost.

"HEAD", being defined as the thing I have checked out, should not be 
changed, I agree.

But the nomenclature here is a bit misleading.  Really, "HEAD" could be 
any commit.  It doesn't have to be a childless commit.  The fact that my 
HEAD was childless at the time I checked it out doesn't necessarily mean 
that it must remain childless forever.

Let's back it up a moment.  I change file1 and you change file2.  These 
are non-colliding changes.  They can be trivially merged and yet git 
refuses to push between our repositories.

The refusal seems arbitrary.  It could just as easily accept my change, 
leave your HEAD pointing where it was, but move the "master" pointer to 
point to the merged commit.  This is exactly what it does if I pull your 
changes into my repository.  I just can't ever push them again after 
this happens.  (I could push them previously.)

> Now this is where you say, if git only supported multiple HEADs the
> problem would go away.

Right.

> I could update my version of master and you
> could update your version of master and there would be no conflict.

There'd be a conflict.  But we'd be able to update anyway.  I'd be able 
to see your changes in my repository by default.  You'd be able to see 
mine.  And either one of us could merge, commit, and push the merge. 
Until then, the collision could be carried and propagated by multiple 
repositories around our repository network.  Maybe a third person would 
integrate them for us.

> And...of course you can with git.  I don't update your master, what
> you have checked out, I update what you know is my master.  Then when
> you are done, you get to say "merge my master with your master" or
> "instead of committing this change on my branch, let me try this last
> change I made on top of the changes you made" or whatever you want to
> say.

Yes.  And I have no choice.  I must say that at every repository I own, 
every time I push or pull changes, tracking whether those have been 
merged or not, even when 99% of my changes could have been trivially 
merged, owned by me, in repositories I own.  And I'm forced to do manual 
merges and extra pulls in the most common collision situation I run 
into, which can be handled automatically by other systems like 
mercurial, even subversion.

My problem is that I must necessarily manage 10's of repositories for my 
own work.  These extra steps mean a geometric increase in complexity and 
in error potential over something like mercurial, which maintains the 
"common branch" illusion automatically for me or something like 
subversion which genuinely has a common branch.

I don't need separate branches for each repository.  What I really want 
is a common branch whose changes I can push back and forth between the 
various repositories, or coordinate through a central cache, without 
worrying about the underlying details that git is forcing me to confront.

I think I'm beginning to understand what git does offer now.  Thank you 
for the help with clarifications.  I just don't like it.  It's a huge 
let down for me in my context from working with systems like mercurial 
which make my life easier.  Quite frankly, git is a huge amount of work 
for me by comparison to mercurial for no added benefit, or even by 
comparison to subversion, with only minor benefits in most situations 
over subversion.

> So...what's not possible?

In effect, any interesting activities involving push or any workflows 
that require pushing.  Most of them can probably be worked around by 
using a pull architecture instead, but that adds an unnecessary 
explosion of complexity in many cases such as the one I'm facing.

In particular, sharing a branch becomes problematic with git.

--rich

  reply	other threads:[~2012-05-01  3:04 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30 22:30 Newbie grief Rich Pixley
2012-04-30 23:31 ` Seth Robertson
2012-05-01  1:15   ` Rich Pixley
2012-05-01  1:32     ` Junio C Hamano
2012-05-01  1:55       ` Rich Pixley
2012-05-01  3:44     ` Sitaram Chamarty
2012-05-01 11:14       ` Ted Ts'o
2012-05-01 16:13         ` Sitaram Chamarty
2012-05-01 18:15           ` Rich Pixley
2012-05-01 18:20             ` Michael Witten
2012-05-01 18:52               ` Rich Pixley
2012-05-02 21:28                 ` Jakub Narebski
2012-05-01 18:42             ` Randal L. Schwartz
2012-05-01 20:52               ` Rich Pixley
2012-05-01 21:05                 ` Randal L. Schwartz
2012-05-01 21:12                   ` Junio C Hamano
2012-05-01 21:25                     ` Rich Pixley
2012-05-01 21:28                       ` Randal L. Schwartz
2012-05-01 21:57                         ` Rich Pixley
2012-05-01 22:56                           ` Michael Witten
2012-05-01 23:55                             ` Philip Oakley
2012-05-03 16:08                               ` Hallvard Breien Furuseth
2012-05-03 18:20                                 ` Rich Pixley
2012-05-03 23:04                                   ` Hallvard Breien Furuseth
2012-05-03 23:06                                     ` Hallvard Breien Furuseth
2012-05-03 18:46                             ` Rich Pixley
2012-05-03 21:09                             ` Junio C Hamano
2012-05-03 22:44                               ` Rich Pixley
2012-05-03 22:53                                 ` Randal L. Schwartz
2012-05-03 22:59                                 ` Junio C Hamano
2012-05-04 19:23                                 ` Felipe Contreras
2012-05-04 19:30                             ` Felipe Contreras
2012-05-04 19:41                               ` Michael Witten
2012-05-01 21:29                   ` Rich Pixley
2012-05-01 21:39                     ` Randal L. Schwartz
2012-05-01 22:07                       ` Rich Pixley
2012-05-01 22:17                         ` Andreas Ericsson
2012-05-01 23:01                         ` PJ Weisberg
2012-05-03 18:43                           ` Rich Pixley
2012-05-03 19:09                             ` Nathan Gray
2012-05-03 19:16                               ` Rich Pixley
2012-05-03 20:14                                 ` Randal L. Schwartz
2012-05-03 20:52                                   ` Rich Pixley
2012-05-04 15:56                                     ` Mark Brown
2012-05-04 18:23                                       ` Rich Pixley
2012-05-04 19:14                                         ` Jakub Narebski
2012-05-04 20:00                                         ` Mark Brown
2012-05-02 14:21                         ` Hallvard Breien Furuseth
2012-05-02 15:21                           ` Michael Witten
2012-05-03 12:23                             ` Hallvard Breien Furuseth
2012-05-03 12:53                               ` Randal L. Schwartz
2012-05-03 16:09                               ` Michael Witten
2012-05-03 16:20                                 ` Hallvard Breien Furuseth
2012-05-03 16:44                                   ` Michael Witten
2012-05-03 18:26                                   ` Rich Pixley
2012-05-03 19:33                                     ` Ted Ts'o
2012-05-01 23:30                     ` Felipe Contreras
2012-05-03 18:31                       ` Rich Pixley
2012-05-03 18:58                       ` Rich Pixley
2012-05-04 14:09                         ` Andreas Ericsson
2012-05-04 14:59                           ` Stephen Bash
2012-05-04 16:29                             ` Mark Brown
2012-05-04 19:13                         ` Felipe Contreras
2012-05-01 18:03         ` Rich Pixley
     [not found]       ` <4FA01C73.5000909@palm.com>
2012-05-02  0:44         ` Sitaram Chamarty
     [not found]   ` <4F9F28F5.2020403@palm.com>
2012-05-01  1:37     ` Seth Robertson
2012-05-01  3:04       ` Rich Pixley [this message]
2012-05-01  5:32         ` Michael Witten
2012-05-01  6:21           ` Junio C Hamano
2012-05-01  6:24             ` Michael Witten
2012-05-01 17:29             ` Rich Pixley
2012-05-01 17:33           ` Rich Pixley
2012-05-03 19:13           ` Rich Pixley
2012-05-03 20:19             ` Ronan Keryell
2012-05-03 21:13               ` Junio C Hamano
2012-05-03 22:23                 ` Ronan Keryell
2012-05-03 22:33                 ` Rich Pixley
2012-05-03 22:39                   ` Rich Pixley
2012-05-04  1:01                     ` Illia Bobyr
2012-05-04  3:13                       ` Nathan Gray
2012-05-04  4:35                         ` Michael Witten
2012-05-04  5:25                           ` Junio C Hamano
2012-05-04 10:09                             ` Carlos Martín Nieto
2012-05-04 14:50                               ` Junio C Hamano
2012-05-04 17:39                                 ` Junio C Hamano
2012-05-04 16:46                               ` Nathan Gray
2012-05-04 17:17                                 ` Illia Bobyr
2012-05-04 18:10                               ` Rich Pixley
2012-05-04 17:57                           ` Rich Pixley
2012-05-04 19:22                             ` Michael Witten
2012-05-04 19:18                         ` Andrew Sayers
2012-05-04 18:57             ` Jérôme Benoit
2012-05-04 20:03             ` Felipe Contreras
2012-05-04 20:27               ` Junio C Hamano
2012-05-04 20:45                 ` Felipe Contreras
2012-05-04 21:29                   ` Rich Pixley
2012-05-04 22:05                     ` Felipe Contreras
2012-04-30 23:35 ` Jan Krüger
2012-05-01 18:59   ` Rich Pixley
2012-05-02  8:25 ` Philippe Vaucher

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=4F9F52B9.9060508@palm.com \
    --to=rich.pixley@palm.com \
    --cc=git@vger.kernel.org \
    --cc=in-gitvger@baka.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).