{"thread":{"id":"33662","subject":"git merge/rebase ref -P ref","startedAt":"2013-04-28T15:35:50Z","lastAt":"2013-04-29T03:46:38Z","messageCount":2,"participants":["ryenus","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"215792","messageId":"CAKkAvawit0L4JKKNs7Di46B=Y0VjPohKNbjnS=r07VhafXu4kQ@mail.gmail.com","threadId":"33662","inReplyTo":null,"subject":"git merge/rebase ref -P ref","fromName":"ryenus","fromEmail":"ryenus@gmail.com","sentAt":"2013-04-28T15:35:50Z","receivedAt":"2013-04-28T15:35:50Z","isPatch":false,"sender":{"key":"ryenus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/610161?v=4"},"body":"The inverted meaning of {ours,theirs} for rebase could be very\nconfusing to some, especially to new uses, for me every time I\nmerge/rebase I need to think about it to make sure I've made it right.\n\nWhat about making it more intuitive?\n\nWe can and a new option (like '-P') for people to specify the\npreferred branch/ref by it's name.\n\nE.g. assume I have two branches, namely 'dev' and 'exp', and I prefer\nthe changeset on the 'dev' branch when I merge or rebase, so that I\ncan do it with\n\n# using merge\ngit checkout dev\ngit merge exp -P dev\n\nOR\n\n# using rebase\ngit checkout exp\ngit rebase dev -P dev\n"},{"id":"215818","messageId":"7vvc76ngm9.fsf@alter.siamese.dyndns.org","threadId":"33662","inReplyTo":"CAKkAvawit0L4JKKNs7Di46B=Y0VjPohKNbjnS=r07VhafXu4kQ@mail.gmail.com","subject":"Re: git merge/rebase ref -P ref","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-29T03:46:38Z","receivedAt":"2013-04-29T03:46:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"ryenus <ryenus@gmail.com> writes:\n\n> The inverted meaning of {ours,theirs} for rebase could be very\n> confusing to some, especially to new uses, for me every time I\n> merge/rebase I need to think about it to make sure I've made it right.\n\nThe key point to remember is \"git rebase origin master\" is *not*\nabout integrating other people's changes to your work.  It is a way\nto replay your work on top of others' work.\n\nWhen I try to rebase a topic, e.g.\n\n    git checkout jc/format-patch\n    git rebase 8ee3860\n    \nThe conflicts in pretty.c looks like this:\n\n    <<<<<<< HEAD\n    static const char *show_ident_date(const struct ident_split *ident,\n                                       enum date_mode mode)\n    {\n    ...\n            return show_date(date, tz, mode);\n    =======\n    static int is_current_user(const struct pretty_print_context *pp,\n                               const char *email, size_t emaillen,\n                               const char *name, size_t namelen)\n    {\n    ...\n                    !memcmp(myname, name, namelen));\n    >>>>>>> format-patch: --inline-single\n    }\n\nWe are replaying the commits on \"jc/format-patch\" topic on a history\nthat leads to 8ee3860, and the line \">>>>>\" shows what commit we are\nreplaying\n\n    $ git log --oneline 8ee3860..jc/format-patch\n    be1a07f format-patch: --inline-single\n    47d6c5f format-patch: rename \"no_inline\" field\n\nOn the other hand, when I try to do the same integration with a\nmerge, e.g.\n\n    git checkout 8ee3860\n    git merge jc/format-patch\n\nWe would see the same conflicts like this:\n\n    <<<<<<< HEAD\n    static const char *show_ident_date(const struct ident_split *ident,\n                                       enum date_mode mode)\n    {\n    ...\n            return show_date(date, tz, mode);\n    =======\n    static int is_current_user(const struct pretty_print_context *pp,\n                               const char *email, size_t emaillen,\n                               const char *name, size_t namelen)\n    {\n    ...\n                    !memcmp(myname, name, namelen));\n    >>>>>>> jc/format-patch\n    }\n\nAgain, the name of the branch that is merged appears on \">>>>>\"\nline.\n"}]}