{"thread":{"id":"8639","subject":"The --no-commit blues","startedAt":"2007-06-18T15:06:26Z","lastAt":"2007-06-19T08:52:03Z","messageCount":3,"participants":["Brian L. Troutwine","Alex Riesen","Sergio"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"45271","messageId":"200706180806.26255.goofyheadedpunk@gmail.com","threadId":"8639","inReplyTo":null,"subject":"The --no-commit blues","fromName":"Brian L. Troutwine","fromEmail":"goofyheadedpunk@gmail.com","sentAt":"2007-06-18T15:06:26Z","receivedAt":"2007-06-18T15:06:26Z","isPatch":false,"sender":{"key":"goofyheadedpunk@gmail.com","avatar":null},"body":"I've got two branches, one which I commit to quite frequently and another only \nperiodically, call them inward and outward. Inward is where I do my work, \noutward tracks an SVN repository. I'd like to merge inward to outward without \ncommitting the merge so that I may provide a commit message appropriate for \nchecking in to the SVN repo. \n\n`git merge --no-commit inward' from branch outward, I thought, should do it. \nPerforming a `git status' and a `git log' directly afterward seem to indicate \nthat the merge was committed. `git commit' insists the branch is now up to \ndate.\n\nAm I going about this the wrong way? What does --no-commit mean, if I am?\n\n(Also, I asked this on #git earlier. If anyone happens to idle there, pardon \nme for re-posting this so quickly. I've got terrible lag this morning, enough \nto time out frequently.)\n"},{"id":"45272","messageId":"81b0412b0706180904l52076d7l96797fee0deaf97c@mail.gmail.com","threadId":"8639","inReplyTo":"200706180806.26255.goofyheadedpunk@gmail.com","subject":"Re: The --no-commit blues","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-06-18T16:04:03Z","receivedAt":"2007-06-18T16:04:03Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 6/18/07, Brian L. Troutwine <goofyheadedpunk@gmail.com> wrote:\n> I've got two branches, one which I commit to quite frequently and another only\n> periodically, call them inward and outward. Inward is where I do my work,\n> outward tracks an SVN repository. I'd like to merge inward to outward without\n> committing the merge so that I may provide a commit message appropriate for\n> checking in to the SVN repo.\n>\n> `git merge --no-commit inward' from branch outward, I thought, should do it.\n> Performing a `git status' and a `git log' directly afterward seem to indicate\n> that the merge was committed. `git commit' insists the branch is now up to\n> date.\n\nEither it was a fast-forward (IOW, the outward had no changes since you\nchanged inward, and inward is derived from outward), or we have a bug\n(which I cannot reproduce).\n\n> Am I going about this the wrong way? What does --no-commit mean, if I am?\n\nexactly what it say: do not commit. Fast-forwards do not commit, just update\nyour HEAD, index and working directory with the new changed (from inward\nin your case).\n"},{"id":"45331","messageId":"loom.20070619T102934-84@post.gmane.org","threadId":"8639","inReplyTo":"200706180806.26255.goofyheadedpunk@gmail.com","subject":"Re: The --no-commit blues","fromName":"Sergio","fromEmail":"sergio.callegari@gmail.com","sentAt":"2007-06-19T08:52:03Z","receivedAt":"2007-06-19T08:52:03Z","isPatch":false,"sender":{"key":"sergio.callegari@gmail.com","avatar":"https://gravatar.com/avatar/c98f41317e0422c1e630385de0e3970227b8e5ad15f35ba8586066467cc833bc?d=mp&s=160"},"body":"Brian L. Troutwine <goofyheadedpunk <at> gmail.com> writes:\n\n> \n> I've got two branches, one which I commit to quite frequently and another only \n> periodically, call them inward and outward. Inward is where I do my work, \n> outward tracks an SVN repository. I'd like to merge inward to outward without \n> committing the merge so that I may provide a commit message appropriate for \n> checking in to the SVN repo. \n> \n> `git merge --no-commit inward' from branch outward, I thought, should do it. \n> Performing a `git status' and a `git log' directly afterward seem to indicate \n> that the merge was committed. `git commit' insists the branch is now up to \n> date.\n> \n\nIf you want the \"whole\" set of changes from inward to appear in outward as a\n/single/ commit with an appropriate commit message, probably you want to use\nalso the --squash option of git merge.\n\nOtherwise, git will preserve the \"structuring\" of the history in many commits.\nThis means that:\n\n- if outward does not need any real merge (because it only needs to be advanced\nto a newer status and not to join some changes of its own with changes from\ninward), git merge will make a \"fast-forward\". In other words, you will see\noutward becoming up to date without the need of any merge-commit at all. BTW\nthat is why --no-commit appears to have no effect in this case: there wouldn't\nbe any merge commit in any case. \n\n- if outward needs a real merge, then git merge will set up everything up to the\npoint of making the merge commit.  Then, depending on the presence of the\n--no-commit option it will or will not make the actual commit.  \n\n> Am I going about this the wrong way? What does --no-commit mean, if I am?\n> \n> (Also, I asked this on #git earlier. If anyone happens to idle there, pardon \n> me for re-posting this so quickly. I've got terrible lag this morning, enough \n> to time out frequently.)\n"}]}