Thread (1 message) 1 message, 1 author, 2016-06-15

Re: git merge/rebase ref -P ref

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:03

ryenus [off-list ref] writes:
The inverted meaning of {ours,theirs} for rebase could be very
confusing to some, especially to new uses, for me every time I
merge/rebase I need to think about it to make sure I've made it right.
The key point to remember is "git rebase origin master" is *not*
about integrating other people's changes to your work.  It is a way
to replay your work on top of others' work.

When I try to rebase a topic, e.g.

    git checkout jc/format-patch
    git rebase 8ee3860
    
The conflicts in pretty.c looks like this:

    <<<<<<< HEAD
    static const char *show_ident_date(const struct ident_split *ident,
                                       enum date_mode mode)
    {
    ...
            return show_date(date, tz, mode);
    =======
    static int is_current_user(const struct pretty_print_context *pp,
                               const char *email, size_t emaillen,
                               const char *name, size_t namelen)
    {
    ...
                    !memcmp(myname, name, namelen));
    >>>>>>> format-patch: --inline-single
    }

We are replaying the commits on "jc/format-patch" topic on a history
that leads to 8ee3860, and the line ">>>>>" shows what commit we are
replaying

    $ git log --oneline 8ee3860..jc/format-patch
    be1a07f format-patch: --inline-single
    47d6c5f format-patch: rename "no_inline" field

On the other hand, when I try to do the same integration with a
merge, e.g.

    git checkout 8ee3860
    git merge jc/format-patch

We would see the same conflicts like this:

    <<<<<<< HEAD
    static const char *show_ident_date(const struct ident_split *ident,
                                       enum date_mode mode)
    {
    ...
            return show_date(date, tz, mode);
    =======
    static int is_current_user(const struct pretty_print_context *pp,
                               const char *email, size_t emaillen,
                               const char *name, size_t namelen)
    {
    ...
                    !memcmp(myname, name, namelen));
    >>>>>>> jc/format-patch
    }

Again, the name of the branch that is merged appears on ">>>>>"
line.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help