{"thread":{"id":"14153","subject":"Re: policy and mechanism for less-connected clients","startedAt":"2008-06-25T21:35:46Z","lastAt":"2016-08-14T00:43:15Z","messageCount":7,"participants":["David Jeske","Jakub Narebski","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"81195","messageId":"1784.50359167091$1214430241@news.gmane.org","threadId":"14153","inReplyTo":"willow-jeske-01l6XqjOFEDjC=91jv","subject":"Re: policy and mechanism for less-connected clients","fromName":"David Jeske","fromEmail":"jeske@willowmail.com","sentAt":null,"receivedAt":"2008-06-25T21:35:46Z","isPatch":false,"sender":{"key":"jeske@willowmail.com","avatar":null},"body":"Some answers thanks to Jakub...\n\n-- David Jeske wrote:\n> : \"ncvs up\" ->\n> :\n> : git stash; git pull; git apply;\n> : git diff --stat <baseof:current branch> - un-pushed filenames\n> : git-show-branch <current branch> - un-pushed comments\n>\n> Question: when I say \"baseof:current branch\", I mean \"the common-ancestor\n> between my local-repo tracking branch and the remote-repo branch it's\n> tracking\". How do I find that out?\n\nI'm told I need...\n\ngit diff --stat `git-merge-base HEAD ORIG_HEAD`\n\n> : \"ncvs commit\" -> \"git commit; git push <only this branch>;\"\n>\n> Question: how do I only push the branch I'm on? \"eg\" says it does this, but\n> from a quick look at the code, it wasn't obvious to me how.\n\nand...\n\ngit push HEAD\n\n\nwhich just leaves this one....\n\nQuestion: How do I create a branch on a remote repo when I'm on\nmy local machine, without sshing to it?\n"},{"id":"81196","messageId":"g3ufoa$ps3$1@ger.gmane.org","threadId":"14153","inReplyTo":"1784.50359167091$1214430241@news.gmane.org","subject":"Re: policy and mechanism for less-connected clients","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-25T22:10:18Z","receivedAt":"2008-06-25T22:10:18Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"David Jeske wrote:\n\n> Question: How do I create a branch on a remote repo when I'm on\n> my local machine, without sshing to it?\n\nPush into it.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"81197","messageId":"7viqvxxix0.fsf@gitster.siamese.dyndns.org","threadId":"14153","inReplyTo":"1784.50359167091$1214430241@news.gmane.org","subject":"Re: policy and mechanism for less-connected clients","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-25T22:13:15Z","receivedAt":"2008-06-25T22:13:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"David Jeske\" <jeske@willowmail.com> writes:\n\n>> : \"ncvs up\" ->\n>> :\n>> : git stash; git pull; git apply;\n\nFirst of all, if you are in CVS mindset, you may not want to necessarily\ndo \"git pull\", but \"git fetch\" followed by \"git rebase\".\n\nI suspect the last one in the above sequence of yours is \"git stash pop\".\nDefinitely not \"git apply\" without any argument which is a no-op.\n\n>> : git diff --stat <baseof:current branch> - un-pushed filenames\n\n\"git diff [--options] origin...\" (three-dots) is often used.  This is a\nshorthand for:\n\n\tgit diff [--options] $(git merge-base origin HEAD) HEAD\n\nthat is, \"show me what I did since I forked from origin\".\n\n>> : git-show-branch <current branch> - un-pushed comments\n\nThis would be useful if you are using \"fetch + rebase\", but in any case\n\n\tgit log --graph --pretty=oneline origin..\n\nmay be prettier these days.  --graph is a recent invention that appeared\nfirst in 1.5.6.\n\n> Question: How do I create a branch on a remote repo when I'm on\n> my local machine, without sshing to it?\n\nI hope that the question is not \"How do I do anything on a remote without\nhaving any network connection to it\" as its answer cannot be anything but\n\"telepathy\".\n"},{"id":"81204","messageId":"9505.40933195061$1214435222@news.gmane.org","threadId":"14153","inReplyTo":"7viqvxxix0.fsf@gitster.siamese.dyndns.org","subject":"Re: policy and mechanism for less-connected clients","fromName":"David Jeske","fromEmail":"jeske@willowmail.com","sentAt":null,"receivedAt":"2008-06-25T23:02:28Z","isPatch":false,"sender":{"key":"jeske@willowmail.com","avatar":null},"body":"-- Junio C Hamano wrote:\n> >> : \"ncvs up\" ->\n> >> :\n> >> : git stash; git pull; git apply;\n>\n> First of all, if you are in CVS mindset, you may not want to necessarily\n> do \"git pull\", but \"git fetch\" followed by \"git rebase\".\n\nI don't want to replicate CVS behavior, just the workflow. I've considered\nrebase, but the diagrams on the documentation page look scarry. I want to keep\nthe dag-nodes made by their local git commit;. At those commits the code worked\nand tested in their tree. rebase looks like it tosses those dag-nodes when it\nrewrites the diffs -- who knows if the tests actually pass for every point\nalong that new rebase. That's no good.\n\nI can see the use of rebase when your job is to \"author an understandable\npublic source tree\", but I'm working on SCM, where the goal is to be able to\nreproduce the state of past successes reliably.\n\nI want someone to be able to checkout what was actually in the user's local\nclient as they were working. Which means I think I want \"fetch and merge\" which\nis pull. Did I get that wrong?\n\n> I suspect the last one in the above sequence of yours is \"git stash pop\".\n> Definitely not \"git apply\" without any argument which is a no-op.\n\nI meant to type \"git stash apply\", but I think you're right, pop is what I\nwanted.\n\n> >> : git diff --stat <baseof:current branch> - un-pushed filenames\n>\n> \"git diff [--options] origin...\" (three-dots) is often used. This is a\n> shorthand for:\n>\n> git diff [--options] $(git merge-base origin HEAD) HEAD\n>\n> that is, \"show me what I did since I forked from origin\".\n\nI'm still a little foggy on the remote referenecs, but remember I have two\nremotes (shared) and (personal). Something in the docs led me to believe\n'origin' was repository wide, not private to each branch. Is \"origin\" a magic\nname for the current branch's target?\n\n> >> : git-show-branch <current branch> - un-pushed comments\n>\n> This would be useful if you are using \"fetch + rebase\", but in any case\n>\n> git log --graph --pretty=oneline origin..\n\nAhh, yes, Thanks!. How does this interact with the \"pull\" I just did?\n\nWhat I want is \"show me the commit messages (and sha1 keys) for changes in my\nlocal branch that are not yet submitted to it's remote tracking location\"\n\nWill that command above include the commit lines that came down in my pull\n(fetch/merge)? If so, how do I not include them?\n\n> > Question: How do I create a branch on a remote repo when I'm on\n> > my local machine, without sshing to it?\n>\n> I hope that the question is not \"How do I do anything on a remote without\n> having any network connection to it\" as its answer cannot be anything but\n> \"telepathy\".\n\nFunny. I'm asking how I can run a command locally, that during the next \"git\npush HEAD\" will cause a branch to be created on a remote repository, without\nassuming that is the same repository that my current branch is pointing to.\nWill this do the trick?\n\ngit branch --track mynewbranch git://myserver/path/foo.git\n# hack hack\ngit commit\ngit push HEAD\n\n- David\n"},{"id":"299233","messageId":"willow-jeske-01l6XqjOFEDjC=91jv","threadId":"14153","inReplyTo":"20080625133458.GE20361@mit.edu","subject":"Re: policy and mechanism for less-connected clients","fromName":"David Jeske","fromEmail":"jeske@willowmail.com","sentAt":null,"receivedAt":"2016-08-14T00:43:13Z","isPatch":false,"sender":{"key":"jeske@willowmail.com","avatar":null},"body":"Thanks for the info about shared object storage for shared repositories. That's\ngreat, and looks like a good implementation method.\n\nPreviously I was thinking in terms of making a different server to change\nbehavior. However, I think the comments I've read are shifting my mindset\ntowards making a client-wrapper. I want to provide a system [wrapper] without\nthe user-burden of thinking about three repositories (local, my-public,\nshared-public). Doing this as a wrapper has other benefits, like the fact that\nusers can treat services like repo.or.cz as the \"networked filesystem of their\nversion control system\", so I like it.\n\nI have a model for the operations of this wrapper below.\n\n-- Theodore Tso wrote:\n> [snip] sharing in-progress work is highly overrated.\n\n_Seeing_ unfinished changes is overrated. However, so is managing multiple\nrepositories and managing which data is shared.\n\nI think my new wrapper approach below eliminates this overly-aggressive sharing\nwhile still reducing complexity for the average user.\n\n> So the way I would do things is to simply encourage people to do start\n> their work by branching off of an up-to-date master branch, but *not*\n> do any git pulls or git pushes.\n\nYou confused me here. If their repo.or.cz private repository is their only way\nof sharing (because their home directory is inaccessible and emailing patches\nis cumbersome), how do they exchange their own changes without pushing? Even in\na short time on git mailing list I see mini-unfinished-patches being posted.\n\n> [ description of commit rewriting, rebase, push ]\n\nThe method you describe is burdening all users with learning a bunch of new\nconcepts to do things that are unnecessary micromanagement for their needs. I'd\nprefer to give my users many of the benefits of DVCS/git with a\ncommand/argument set 1/20th the size and a much simpler mental model.\n\nMost of the software we're all using was developed while working with\ncentralized source control, where people just hack and commit and those commits\nare not even known-working. They don't bother with patch/commit rewriting and\nmanagement, and it works out just fine. I can see how that finer granularity\nmay be valuable for linux kernel coordinators. However, most projects don't\nneed to bother with all that, and even in the ones that do, most of their\ncontributors don't.\n\nDespite the success of centralized revision control, distributed source control\nrevision models have some very attractive features which can add efficiency to\na shared-central-repo model without straying far from the familiar (cvs up;\nhack; hack; cvs up; cvs commit;) workflow. I read some commentary from Linus\nthat compared git to a 'filesystem', and that's what I see.. a really awesome\nunderlying set of mechanisms for implementing SCM.. I'm trying to understand\nhow to layer an easy to use SCM system on top if it.\n\nSome 'git' users might say the right thing to do is do a different project, but\nI think, just like with the filesystem-analogy, there is significant benefit to\nsharing a single repository model so a simple source control system can then be\nused in powerful ways by powerful users. This is similar to the direction \"eg\"\n(easy git) is heading, but more extreme and extending to the server.\n\nIn fact, it seems like we might be better off if all of these source control\nuser-interfaces (cvs, perforce, git, eg, mercurial, etc. etc.) could be written\non top of a version-control-api that they shared. Witness the similar\nimplementation strategies of this modern rash of DVCS systems.\n\n--------------------------------------------------------------\n\nI'll try to explain my wrapper model in terms of an example... Imagine I'm\ngoing to deliver a \"cvs drop in replacement\", ncvs, that mostly keeps the cvs\nmental model, but is implemented underneath using git and just works better\nthan cvs (yet is simpler than git). I'll use the exact cvs command parameters\nfor illustration, but I wouldn't plan to do this. Notice how each ncvs command\nuses many git commands. It's possible these things should be done in terms of\nplumbing instead of porcelain to reduce dependence on git changes, but it's\nmore concise to express them as porcelain.\n\n>From the earlier feedback, there are now two repositories, one is considered\nthe \"shared-root\" while the other is the \"user\" repository.\n\n(1) make \"cvs update\" safe, make it easy to see granular comments for things\nyou have not pushed\n\nCVS users do potentially destructive merges all the time. Despite the way we\nuse terminology, working files ARE a branch, and \"cvs up\" IS a merge. That\nmerge can require edits to resolve, and after those edits are complete, the\nprevious state is NOT recoverable. There is no reason for this. We can easily\nsave the delta by just making \"cvs up\" equal \"git commit; git pull;\", or\nalternately, \"git stash; git pull; git apply;\".\n\n: \"ncvs up\" ->\n:\n: git stash; git pull; git apply;\n: git diff --stat <baseof:current branch> - un-pushed filenames\n: git-show-branch <current branch> - un-pushed comments\n\nQuestion: when I say \"baseof:current branch\", I mean \"the common-ancestor\nbetween my local-repo tracking branch and the remote-repo branch it's\ntracking\". How do I find that out?\n\nAdding \"git diff --stat <baseof:current branch>\" helps keep us aware of what\nchanges are in our local repo. Any files not pushed up to the branch head on\nthe server are seen. Likewise with \"git-show-branch <current branch>\" (which\nsomehow is not the same as git-show-branch --current).\n\n(2) make \"planned ahead of time\" branches cheap to make\n\n\"cvs up\" is the easiest merge in cvs, therefore, separate sets of checked out\nworking files become the most common form of branching in cvs. They are\nbasically personal work branches that you can't commit on, and can't\ncollaborate on. I've seen developers with cvs working directories weeks or\nmonths old because that's an easier way to work on different ideas than\ncreating a branch and checking them in. DVCS fixes this, by making branches\ncheap to make, and by making all branch merges closer to the simplicity of\ncvs's easy branch merge \"cvs up\". However, I don't need to burden the user with\nthe extra complexity and workload of the default being local branches, which\nthey then need to do more work to share. I want branches to be shared by\ndefault.\n\n: \"ncvs tag -b --shared $branch\" ->\n:\n: [ create a branch on the \"shared root\" repo, pointing\n:   to where I am in my local tree, if I have permission ]\n:  git branch --track $branch origin/$branch\n\n: \"ncvs tag -b mybranch\n:\n: [ create a branch on my \"user\" repo, pointing to where I am\nin my local tree, if I have permission ]\n: git branch --track $mybranch my-origin/$branch\n\nQuestion: I'm not sure what commands to use above. How do I create a branch on\na remote repo when I'm on my local machine, without sshing to it?\n\nThe advantages of git's repository over cvs's repository in this use-case are\nnot created because the branch is on the local machine. In fact, we also\ncreated it on the server. The benefit comes from the git revision storage model\nbeing faster and BETTER.\n\nThen to switch our working pointer to this branch, we might do:\n\n: \"ncvs up -r mybranch\" ->\n:\n: git stash; git checkout mybranch; git pull;\n: git stash show --relevant --recent;\n\nOur \"safe update\" automatically saved away any local directory changes before\nswitching off to the branch (if there were any). Our \"stash show\" is there\nalways to show us if any stashes hang off a recent parent of the tree we just\nswitched to, but it only shows them if they are hanging off this tree, and only\nif they are recent. If there is, we might want to look at or grab it, or we\nmight just ignore it and not care.\n\n(3) allow users to commit their 'final' changes to others (only on the branch\nthey are on)\n\n: \"ncvs commit\" -> \"git commit; git push <only this branch>;\"\n\nQuestion: how do I only push the branch I'm on? \"eg\" says it does this, but\nfrom a quick look at the code, it wasn't obvious to me how.\n\nDevelopers who are plenty happy with their existing model of never saving local\nchanges, can continue doing what they are doing. This makes the ability to save\nlocal changes an added benefit to the users like me that want to do it, instead\nof an extra burden to the other users. It also simplifies the issue of which\nchanges are pushed to the server and which are not, because pushing is managed\nby \"git push <only this branch>\", not by creating and managing local and remote\nbranch names separately. (easy git took the same approach with push)\n\n(4) Allow users to save interim changes, without ahead of time planning, ahead\nof time nameing, and hopefully, without naming at all.\n\nSaving interim changes in a cvs working tree before merging with head is not\ncheap. Making my own branch tag isn't too hard, but it takes a long time on a\nbig tree. Ironically, perforce made branching mechanism faster while making the\ncognitive load of branch hing much higher.\n\n: \"ncvs save\" -> \"git commit -a\"\n:\n: \"ncvs stash [$name]\" ->\n:\n: $currentbranch = `git branch`\n: $base-ish = '<baseof: current branch>'\n: git stash;\n: git branch -m $currentbranch $name;\n: git checkout $baseish;\n: git branch $currentbranch\n\nThis \"ncvs stash\" is acknowledging the value of the \"git stash\" idea, while\nalso recognizing that when I'm using \"git commit\" regularly, I don't have\nanything in the working set! I really want to stash the changes made since\n\"origin/<branchname>\" and return there with my local <branchname>. This is\nreally after the fact branch creation. If no $name is supplied, then it can\nauto-generate one like stash does.\n\n(5) make it obvious there is a difference between local and remote changes, but\nmake it easy to diff against remote before \"ncvs commit;\"\n\n: \"ncvs diff\" ->\n:\n: echo -n \"since commit(-C): \"  \\\n:   `git diff --shortstat <baseof:current branch>`; \\\n:   echo\n: echo -n \"since save(-S): \" \\\n:   `git diff`; echo\n:\n: \"ncvs diff -S\" -> \"git diff\"\n: \"ncvs diff -C\" -> \"git diff <baseof:current branch>\n--------------------------------------------------------------\n\nI'm primarily trying to understand how to map my model to git.\nContinued thanks for the discussion and help.\n"},{"id":"299234","messageId":"willow-jeske-01l6ZD0vFEDjCXou","threadId":"14153","inReplyTo":"willow-jeske-01l6XqjOFEDjC=91jv","subject":"Re: policy and mechanism for less-connected clients","fromName":"David Jeske","fromEmail":"jeske@willowmail.com","sentAt":null,"receivedAt":"2016-08-14T00:43:14Z","isPatch":false,"sender":{"key":"jeske@willowmail.com","avatar":null},"body":"Some answers thanks to Jakub...\n\n-- David Jeske wrote:\n> : \"ncvs up\" ->\n> :\n> : git stash; git pull; git apply;\n> : git diff --stat <baseof:current branch> - un-pushed filenames\n> : git-show-branch <current branch> - un-pushed comments\n>\n> Question: when I say \"baseof:current branch\", I mean \"the common-ancestor\n> between my local-repo tracking branch and the remote-repo branch it's\n> tracking\". How do I find that out?\n\nI'm told I need...\n\ngit diff --stat `git-merge-base HEAD ORIG_HEAD`\n\n> : \"ncvs commit\" -> \"git commit; git push <only this branch>;\"\n>\n> Question: how do I only push the branch I'm on? \"eg\" says it does this, but\n> from a quick look at the code, it wasn't obvious to me how.\n\nand...\n\ngit push HEAD\n\n\nwhich just leaves this one....\n\nQuestion: How do I create a branch on a remote repo when I'm on\nmy local machine, without sshing to it?\n"},{"id":"299235","messageId":"willow-jeske-01l6aDyTFEDjCfcn","threadId":"14153","inReplyTo":"7viqvxxix0.fsf@gitster.siamese.dyndns.org","subject":"Re: policy and mechanism for less-connected clients","fromName":"David Jeske","fromEmail":"jeske@willowmail.com","sentAt":null,"receivedAt":"2016-08-14T00:43:15Z","isPatch":false,"sender":{"key":"jeske@willowmail.com","avatar":null},"body":"-- Junio C Hamano wrote:\n> >> : \"ncvs up\" ->\n> >> :\n> >> : git stash; git pull; git apply;\n>\n> First of all, if you are in CVS mindset, you may not want to necessarily\n> do \"git pull\", but \"git fetch\" followed by \"git rebase\".\n\nI don't want to replicate CVS behavior, just the workflow. I've considered\nrebase, but the diagrams on the documentation page look scarry. I want to keep\nthe dag-nodes made by their local git commit;. At those commits the code worked\nand tested in their tree. rebase looks like it tosses those dag-nodes when it\nrewrites the diffs -- who knows if the tests actually pass for every point\nalong that new rebase. That's no good.\n\nI can see the use of rebase when your job is to \"author an understandable\npublic source tree\", but I'm working on SCM, where the goal is to be able to\nreproduce the state of past successes reliably.\n\nI want someone to be able to checkout what was actually in the user's local\nclient as they were working. Which means I think I want \"fetch and merge\" which\nis pull. Did I get that wrong?\n\n> I suspect the last one in the above sequence of yours is \"git stash pop\".\n> Definitely not \"git apply\" without any argument which is a no-op.\n\nI meant to type \"git stash apply\", but I think you're right, pop is what I\nwanted.\n\n> >> : git diff --stat <baseof:current branch> - un-pushed filenames\n>\n> \"git diff [--options] origin...\" (three-dots) is often used. This is a\n> shorthand for:\n>\n> git diff [--options] $(git merge-base origin HEAD) HEAD\n>\n> that is, \"show me what I did since I forked from origin\".\n\nI'm still a little foggy on the remote referenecs, but remember I have two\nremotes (shared) and (personal). Something in the docs led me to believe\n'origin' was repository wide, not private to each branch. Is \"origin\" a magic\nname for the current branch's target?\n\n> >> : git-show-branch <current branch> - un-pushed comments\n>\n> This would be useful if you are using \"fetch + rebase\", but in any case\n>\n> git log --graph --pretty=oneline origin..\n\nAhh, yes, Thanks!. How does this interact with the \"pull\" I just did?\n\nWhat I want is \"show me the commit messages (and sha1 keys) for changes in my\nlocal branch that are not yet submitted to it's remote tracking location\"\n\nWill that command above include the commit lines that came down in my pull\n(fetch/merge)? If so, how do I not include them?\n\n> > Question: How do I create a branch on a remote repo when I'm on\n> > my local machine, without sshing to it?\n>\n> I hope that the question is not \"How do I do anything on a remote without\n> having any network connection to it\" as its answer cannot be anything but\n> \"telepathy\".\n\nFunny. I'm asking how I can run a command locally, that during the next \"git\npush HEAD\" will cause a branch to be created on a remote repository, without\nassuming that is the same repository that my current branch is pointing to.\nWill this do the trick?\n\ngit branch --track mynewbranch git://myserver/path/foo.git\n# hack hack\ngit commit\ngit push HEAD\n\n- David\n"}]}