On Tue, Jan 14, 2020 at 3:28 PM Jonathan Wakely <jwak...@redhat.com> wrote:
>
> On 14/01/20 15:08 +0100, Richard Biener wrote:
> >On Tue, Jan 14, 2020 at 2:37 PM Jonathan Wakely <jwak...@redhat.com> wrote:
> >>
> >> I really think people should be reviewing what they're about to push
> >> before doing it.
> >>
> >> OK for wwwdocs?
> >
> >So I figure that first doing the git push with -n -v and then reviewing
> >the pushed changes (cut&paste the revision range) with git show
> >is a workflow easy to remember and less "implicit" than your wording
>
> "cut&paste the revision range" seems awfully tedious to me ;-)
>
> The equivalent is 'git show @{u}..' or if you don't want to remember
> the @{u} thing (aka @{upstream}), you can name the branch explicitly:
>
>    git show origin/master..
>
> or even more explicitly (but identical):
>
>    git show origin/master..HEAD
>
> >(I dont' understand what I actually should _do_ with to review the
> >changes for your description)
>
> If you run the commands, isn't it obvious? (Genuine question)
>
> master wwwdocs$ git log @{u}..
> commit 0eecf8a69a52cd27faeea64c8269a6df3f8db855 (HEAD -> master)
> Author: Jonathan Wakely <jwak...@redhat.com>
> Date:   Tue Jan 14 13:34:02 2020 +0000
>
>      Recommend reviewing local changes before pushing them
>
> commit a449e14116456cf66ea15d4aca203a50b55f6e20
> Author: Jonathan Wakely <jwak...@redhat.com>
> Date:   Tue Jan 14 13:16:12 2020 +0000
>
>      Fix indentation of .ssh/config snippet
>
> Here git log shows two local commits. If I push, they'll both be
> pushed. Is that what I meant to do, or did I forget that a449e1411 was
> also in my local branch?
>
> You should check that only the commits you expect are shown in the
> log.
>
> You can also just do "git log" and check which commits are more recent
> than the one shown as the upstream:
>
> $ git log
> commit 9e502f6deae9f821bd7079aad5f98a4f3bae15cf (HEAD -> master)
> Author: Jonathan Wakely <jwak...@redhat.com>
> Date:   Tue Jan 14 13:34:02 2020 +0000
>
>      Recommend reviewing local changes before pushing them
>
> commit 83f833b74f2dada4235f1b68b2e3cab5e5bba757
> Author: Jonathan Wakely <jwak...@redhat.com>
> Date:   Tue Jan 14 13:16:12 2020 +0000
>
>      Fix indentation of .ssh/config snippet
>
> commit 10463a79371068a0b32d8babefb9cf2ee409f4d1 (origin/master, origin/HEAD)
> Author: Christophe Lyon <christophe.l...@linaro.org>
> Date:   Tue Jan 14 13:48:19 2020 +0000
>
>      [arm] Document -mpure-code support for v6m in gcc-10
>
> The one marked (origin/master, origin/HEAD) is the commit that is
> upstream, the ones before it are local.
>
> Maybe I should just say use 'git status' and/or 'git log' and check
> that your local branch doesn't contain anything unexpected.
>
> The other command shows the diff between your local branch and
> upstream. Check the diff only contains the differences you expect it
> to.

Guess the -n -v approach is more obvious that it shows what a
random git push command will do rather your description which
is vague as to what kind of push it applies to?

Richard.

Reply via email to