Re: [PATCH v6 4/7] pull: add --merge option

2014-05-02 Thread brian m. carlson
On Fri, May 02, 2014 at 03:14:44PM -0500, Felipe Contreras wrote:
> brian m. carlson wrote:
> > My point is that it's unclear to me what options I need to use to
> > retain the current behavior (fast-forward if possible, merge
> > otherwise) without a warning.
> 
> The current behavior is to always merge (ff or otherwise), just what
> `git merge` would do, so `git pull --merge`. I don't see what's
> confusing about that.

When the documentation says "Forces a merge" without any clarifying
statement, that implies to me that it always creates a new commit.  I'm
certain that I'm not the only person who is going to think that.

Could you please clarify the documentation for --merge and pull.mode to
avoid confusing users?

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187


signature.asc
Description: Digital signature


Re: [PATCH v6 4/7] pull: add --merge option

2014-05-02 Thread Felipe Contreras
brian m. carlson wrote:
> My point is that it's unclear to me what options I need to use to
> retain the current behavior (fast-forward if possible, merge
> otherwise) without a warning.

The current behavior is to always merge (ff or otherwise), just what
`git merge` would do, so `git pull --merge`. I don't see what's
confusing about that.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 4/7] pull: add --merge option

2014-05-02 Thread brian m. carlson
On Thu, May 01, 2014 at 09:41:34PM -0500, Felipe Contreras wrote:
> brian m. carlson wrote:
> > On Thu, May 01, 2014 at 07:00:05PM -0500, Felipe Contreras wrote:
> > > Also, deprecate --no-rebase since there's no need for it any more.
> > > 
> > > Signed-off-by: Felipe Contreras 
> > > ---
> > >  Documentation/git-pull.txt |  8 ++--
> > >  git-pull.sh| 10 +-
> > >  2 files changed, 15 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
> > > index 9a91b9f..767bca3 100644
> > > --- a/Documentation/git-pull.txt
> > > +++ b/Documentation/git-pull.txt
> > > @@ -127,8 +127,12 @@ It rewrites history, which does not bode well when 
> > > you
> > >  published that history already.  Do *not* use this option
> > >  unless you have read linkgit:git-rebase[1] carefully.
> > >  
> > > ---no-rebase::
> > > - Override earlier --rebase.
> > > +-m::
> > > +--merge::
> > > + Force a merge.
> > > ++
> > > +See `pull.mode`, `branch..pullmode` in linkgit:git-config[1] if 
> > > you want
> > > +to make `git pull` always use `--merge`.
> > 
> > So I'm confused here, and maybe you can enlighten me.  As I read this
> > documentation, --merge would always force a merge, like --no-ff.  If so,
> > I don't see an option to preserve the existing behavior, which is the
> > I-don't-care-just-do-it case.  If the behavior is different, then this
> > documentation needs to be improved, I think, along with the
> > documentation earlier in the series.
> 
> I don't understand what is your point.
> 
> So basically you think these should be the same?
> 
>   % git pull --merge --no-merge --rebase --no-rebase
>   % git pull

My point is that it's unclear to me what options I need to use to retain
the current behavior (fast-forward if possible, merge otherwise) without
a warning.  Right now, it looks like --merge is equivalent to --no-ff,
which seems silly, since we already have an option for that.

So my request is that you add an option (command-line and configuration)
that maintains the current behavior, or if there's already such an
option, that the documentation be clear enough so that I can figure it
out.  Because right now, it's not.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187


signature.asc
Description: Digital signature


Re: [PATCH v6 4/7] pull: add --merge option

2014-05-01 Thread Felipe Contreras
brian m. carlson wrote:
> On Thu, May 01, 2014 at 07:00:05PM -0500, Felipe Contreras wrote:
> > Also, deprecate --no-rebase since there's no need for it any more.
> > 
> > Signed-off-by: Felipe Contreras 
> > ---
> >  Documentation/git-pull.txt |  8 ++--
> >  git-pull.sh| 10 +-
> >  2 files changed, 15 insertions(+), 3 deletions(-)
> > 
> > diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
> > index 9a91b9f..767bca3 100644
> > --- a/Documentation/git-pull.txt
> > +++ b/Documentation/git-pull.txt
> > @@ -127,8 +127,12 @@ It rewrites history, which does not bode well when you
> >  published that history already.  Do *not* use this option
> >  unless you have read linkgit:git-rebase[1] carefully.
> >  
> > ---no-rebase::
> > -   Override earlier --rebase.
> > +-m::
> > +--merge::
> > +   Force a merge.
> > ++
> > +See `pull.mode`, `branch..pullmode` in linkgit:git-config[1] if you 
> > want
> > +to make `git pull` always use `--merge`.
> 
> So I'm confused here, and maybe you can enlighten me.  As I read this
> documentation, --merge would always force a merge, like --no-ff.  If so,
> I don't see an option to preserve the existing behavior, which is the
> I-don't-care-just-do-it case.  If the behavior is different, then this
> documentation needs to be improved, I think, along with the
> documentation earlier in the series.

I don't understand what is your point.

So basically you think these should be the same?

  % git pull --merge --no-merge --rebase --no-rebase
  % git pull

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 4/7] pull: add --merge option

2014-05-01 Thread brian m. carlson
On Thu, May 01, 2014 at 07:00:05PM -0500, Felipe Contreras wrote:
> Also, deprecate --no-rebase since there's no need for it any more.
> 
> Signed-off-by: Felipe Contreras 
> ---
>  Documentation/git-pull.txt |  8 ++--
>  git-pull.sh| 10 +-
>  2 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
> index 9a91b9f..767bca3 100644
> --- a/Documentation/git-pull.txt
> +++ b/Documentation/git-pull.txt
> @@ -127,8 +127,12 @@ It rewrites history, which does not bode well when you
>  published that history already.  Do *not* use this option
>  unless you have read linkgit:git-rebase[1] carefully.
>  
> ---no-rebase::
> - Override earlier --rebase.
> +-m::
> +--merge::
> + Force a merge.
> ++
> +See `pull.mode`, `branch..pullmode` in linkgit:git-config[1] if you 
> want
> +to make `git pull` always use `--merge`.

So I'm confused here, and maybe you can enlighten me.  As I read this
documentation, --merge would always force a merge, like --no-ff.  If so,
I don't see an option to preserve the existing behavior, which is the
I-don't-care-just-do-it case.  If the behavior is different, then this
documentation needs to be improved, I think, along with the
documentation earlier in the series.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187


signature.asc
Description: Digital signature


[PATCH v6 4/7] pull: add --merge option

2014-05-01 Thread Felipe Contreras
Also, deprecate --no-rebase since there's no need for it any more.

Signed-off-by: Felipe Contreras 
---
 Documentation/git-pull.txt |  8 ++--
 git-pull.sh| 10 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 9a91b9f..767bca3 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -127,8 +127,12 @@ It rewrites history, which does not bode well when you
 published that history already.  Do *not* use this option
 unless you have read linkgit:git-rebase[1] carefully.
 
---no-rebase::
-   Override earlier --rebase.
+-m::
+--merge::
+   Force a merge.
++
+See `pull.mode`, `branch..pullmode` in linkgit:git-config[1] if you want
+to make `git pull` always use `--merge`.
 
 Options related to fetching
 ~~~
diff --git a/git-pull.sh b/git-pull.sh
index 50c612f..e7e52ec 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -15,6 +15,10 @@ require_work_tree_exists
 cd_to_toplevel
 
 
+warn () {
+   printf >&2 'warning: %s\n' "$*"
+}
+
 die_conflict () {
 git diff-index --cached --name-status -r --ignore-submodules HEAD --
 if [ $(git config --bool --get advice.resolveConflict || echo true) = 
"true" ]; then
@@ -142,8 +146,12 @@ do
-r|--r|--re|--reb|--reba|--rebas|--rebase)
mode=rebase
;;
+   -m|--m|--me|--mer|--merg|--merge)
+   mode=merge
+   ;;
--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
-   mode=
+   mode=merge
+   warn "$(gettext "--no-rebase is deprecated, please use --merge 
instead")"
;;
--recurse-submodules)
recurse_submodules=--recurse-submodules
-- 
1.9.2+fc1.19.g85b6256

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html