Re: [PATCH v5 1/6] pull: rename pull.rename to pull.mode
On 2014-04-29 07:17, Felipe Contreras wrote: Also 'branch.name.rebase' to 'branch.name.pullmode'. This way 'pull.mode' can be set to 'merge', and the default can be something else. The old configurations still work, but get deprecated. Should users be warned if both pull.rebase and pull.mode are set? (Also if both branch.name.rebase and branch.name.pullmode are set.) Hmm, thinking about it more, I think I prefer it to *not* warn if both are set (as is currently coded). If the user set *mode then presumably they've read the documentation and know that *mode is the right way to configure the behavior, so a warning would only serve to badger them into cleaning up their config file. And it would annoy users that keep their ~/.gitconfig in a dotfiles repo shared between machines with different versions of Git. I prefer a deprecation note in the documentation as Philip suggests, but I'm OK without one too. -Richard Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Documentation/config.txt | 34 +- Documentation/git-pull.txt | 2 +- branch.c | 4 ++-- builtin/remote.c | 14 -- git-pull.sh| 39 +-- t/t3200-branch.sh | 40 t/t5601-clone.sh | 4 ++-- 7 files changed, 91 insertions(+), 46 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index c26a7c8..5978d35 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -708,7 +708,7 @@ branch.autosetupmerge:: branch.autosetuprebase:: When a new branch is created with 'git branch' or 'git checkout' that tracks another branch, this variable tells Git to set - up pull to rebase instead of merge (see branch.name.rebase). + up pull to rebase instead of merge (see branch.name.pullmode). When `never`, rebase is never automatically set to true. When `local`, rebase is set to true for tracked branches of other local branches. @@ -764,15 +764,15 @@ branch.name.mergeoptions:: option values containing whitespace characters are currently not supported. -branch.name.rebase:: - When true, rebase the branch name on top of the fetched branch, - instead of merging the default branch from the default remote when - git pull is run. See pull.rebase for doing this in a non - branch-specific manner. +branch.name.pullmode:: + When git pull is run, this determines if it would either merge or + rebase the fetched branch. The possible values are 'merge', + 'rebase', and 'rebase-preserve'. See pull.mode for doing this in a + non branch-specific manner. + - When preserve, also pass `--preserve-merges` along to 'git rebase' - so that locally committed merge commits will not be flattened - by running 'git pull'. + When 'rebase-preserve', also pass `--preserve-merges` along to + 'git rebase' so that locally committed merge commits will not be + flattened by running 'git pull'. + *NOTE*: this is a possibly dangerous operation; do *not* use it unless you understand the implications (see linkgit:git-rebase[1] @@ -1881,15 +1881,15 @@ pretty.name:: Note that an alias with the same name as a built-in format will be silently ignored. -pull.rebase:: - When true, rebase branches on top of the fetched branch, instead - of merging the default branch from the default remote when git - pull is run. See branch.name.rebase for setting this on a - per-branch basis. +pull.mode:: + When git pull is run, this determines if it would either merge or + rebase the fetched branch. The possible values are 'merge', + 'rebase', and 'rebase-preserve'. See branch.name.pullmode for doing + this in a non branch-specific manner. + - When preserve, also pass `--preserve-merges` along to 'git rebase' - so that locally committed merge commits will not be flattened - by running 'git pull'. + When 'rebase-preserve', also pass `--preserve-merges` along to + 'git rebase' so that locally committed merge commits will not be + flattened by running 'git pull'. + *NOTE*: this is a possibly dangerous operation; do *not* use it unless you understand the implications (see linkgit:git-rebase[1] diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index 200eb22..9a91b9f 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -117,7 +117,7 @@ locally created merge commits will not be flattened. + When false, merge the current branch into the upstream branch. + -See `pull.rebase`, `branch.name.rebase` and `branch.autosetuprebase` in +See `pull.mode`, `branch.name.pullmode` and `branch.autosetuprebase` in linkgit:git-config[1] if you want to make `git pull` always use `--rebase`
[PATCH v5 1/6] pull: rename pull.rename to pull.mode
Also 'branch.name.rebase' to 'branch.name.pullmode'. This way 'pull.mode' can be set to 'merge', and the default can be something else. The old configurations still work, but get deprecated. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Documentation/config.txt | 34 +- Documentation/git-pull.txt | 2 +- branch.c | 4 ++-- builtin/remote.c | 14 -- git-pull.sh| 39 +-- t/t3200-branch.sh | 40 t/t5601-clone.sh | 4 ++-- 7 files changed, 91 insertions(+), 46 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index c26a7c8..5978d35 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -708,7 +708,7 @@ branch.autosetupmerge:: branch.autosetuprebase:: When a new branch is created with 'git branch' or 'git checkout' that tracks another branch, this variable tells Git to set - up pull to rebase instead of merge (see branch.name.rebase). + up pull to rebase instead of merge (see branch.name.pullmode). When `never`, rebase is never automatically set to true. When `local`, rebase is set to true for tracked branches of other local branches. @@ -764,15 +764,15 @@ branch.name.mergeoptions:: option values containing whitespace characters are currently not supported. -branch.name.rebase:: - When true, rebase the branch name on top of the fetched branch, - instead of merging the default branch from the default remote when - git pull is run. See pull.rebase for doing this in a non - branch-specific manner. +branch.name.pullmode:: + When git pull is run, this determines if it would either merge or + rebase the fetched branch. The possible values are 'merge', + 'rebase', and 'rebase-preserve'. See pull.mode for doing this in a + non branch-specific manner. + - When preserve, also pass `--preserve-merges` along to 'git rebase' - so that locally committed merge commits will not be flattened - by running 'git pull'. + When 'rebase-preserve', also pass `--preserve-merges` along to + 'git rebase' so that locally committed merge commits will not be + flattened by running 'git pull'. + *NOTE*: this is a possibly dangerous operation; do *not* use it unless you understand the implications (see linkgit:git-rebase[1] @@ -1881,15 +1881,15 @@ pretty.name:: Note that an alias with the same name as a built-in format will be silently ignored. -pull.rebase:: - When true, rebase branches on top of the fetched branch, instead - of merging the default branch from the default remote when git - pull is run. See branch.name.rebase for setting this on a - per-branch basis. +pull.mode:: + When git pull is run, this determines if it would either merge or + rebase the fetched branch. The possible values are 'merge', + 'rebase', and 'rebase-preserve'. See branch.name.pullmode for doing + this in a non branch-specific manner. + - When preserve, also pass `--preserve-merges` along to 'git rebase' - so that locally committed merge commits will not be flattened - by running 'git pull'. + When 'rebase-preserve', also pass `--preserve-merges` along to + 'git rebase' so that locally committed merge commits will not be + flattened by running 'git pull'. + *NOTE*: this is a possibly dangerous operation; do *not* use it unless you understand the implications (see linkgit:git-rebase[1] diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index 200eb22..9a91b9f 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -117,7 +117,7 @@ locally created merge commits will not be flattened. + When false, merge the current branch into the upstream branch. + -See `pull.rebase`, `branch.name.rebase` and `branch.autosetuprebase` in +See `pull.mode`, `branch.name.pullmode` and `branch.autosetuprebase` in linkgit:git-config[1] if you want to make `git pull` always use `--rebase` instead of merging. + diff --git a/branch.c b/branch.c index 723a36b..63ce671 100644 --- a/branch.c +++ b/branch.c @@ -71,8 +71,8 @@ void install_branch_config(int flag, const char *local, const char *origin, cons if (rebasing) { strbuf_reset(key); - strbuf_addf(key, branch.%s.rebase, local); - git_config_set(key.buf, true); + strbuf_addf(key, branch.%s.pullmode, local); + git_config_set(key.buf, rebase); } strbuf_release(key); diff --git a/builtin/remote.c b/builtin/remote.c index b3ab4cf..46d3c4d 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -264,7 +264,7 @@ static int config_read_branches(const char *key, const char *value, void *cb)
Re: [PATCH v5 1/6] pull: rename pull.rename to pull.mode
Felipe Contreras wrote [PATCH v5 1/6] pull: rename pull.rename to pull.mode s/pull.rename/pull.rebase/ -- View this message in context: http://git.661346.n2.nabble.com/PATCH-v5-0-6-Reject-non-ff-pulls-by-default-tp7609118p7609129.html Sent from the git mailing list archive at Nabble.com. -- 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 v5 1/6] pull: rename pull.rename to pull.mode
Marat Radchenko wrote: Felipe Contreras wrote [PATCH v5 1/6] pull: rename pull.rename to pull.mode s/pull.rename/pull.rebase/ Right. Will fix. -- 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 v5 1/6] pull: rename pull.rename to pull.mode
From: Felipe Contreras felipe.contre...@gmail.com Also 'branch.name.rebase' to 'branch.name.pullmode'. Sorry I haven't commented earlier. Because the 0/6 explanation isn't a commit, a few extra words would be useful to capture what the 0/6 cover letter said to start the patch series cleanly/clearly e.g. start with Begin the Reject non-ff pulls by default process by creating new config variables which will allow extra options, to replace the old pull configuration options. I didn't immediately grasp why the 'replacement' was happening, rather than it being a creation and a deprecation. This way 'pull.mode' can be set to 'merge', and the default can be something else. The old configurations still work, but get deprecated. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- Documentation/config.txt | 34 +- Documentation/git-pull.txt | 2 +- branch.c | 4 ++-- builtin/remote.c | 14 -- git-pull.sh| 39 +-- t/t3200-branch.sh | 40 t/t5601-clone.sh | 4 ++-- 7 files changed, 91 insertions(+), 46 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index c26a7c8..5978d35 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -708,7 +708,7 @@ branch.autosetupmerge:: branch.autosetuprebase:: When a new branch is created with 'git branch' or 'git checkout' that tracks another branch, this variable tells Git to set - up pull to rebase instead of merge (see branch.name.rebase). + up pull to rebase instead of merge (see branch.name.pullmode). When `never`, rebase is never automatically set to true. When `local`, rebase is set to true for tracked branches of other local branches. @@ -764,15 +764,15 @@ branch.name.mergeoptions:: option values containing whitespace characters are currently not supported. -branch.name.rebase:: - When true, rebase the branch name on top of the fetched branch, - instead of merging the default branch from the default remote when - git pull is run. See pull.rebase for doing this in a non - branch-specific manner. +branch.name.pullmode:: + When git pull is run, this determines if it would either merge or + rebase the fetched branch. The possible values are 'merge', + 'rebase', and 'rebase-preserve'. See pull.mode for doing this in a + non branch-specific manner. I'd think it useful to add that: branch.name.rebase is deprecated. given the large amount of internet cruft about this older config variable name + - When preserve, also pass `--preserve-merges` along to 'git rebase' - so that locally committed merge commits will not be flattened - by running 'git pull'. + When 'rebase-preserve', also pass `--preserve-merges` along to + 'git rebase' so that locally committed merge commits will not be + flattened by running 'git pull'. + *NOTE*: this is a possibly dangerous operation; do *not* use it unless you understand the implications (see linkgit:git-rebase[1] @@ -1881,15 +1881,15 @@ pretty.name:: Note that an alias with the same name as a built-in format will be silently ignored. -pull.rebase:: - When true, rebase branches on top of the fetched branch, instead - of merging the default branch from the default remote when git - pull is run. See branch.name.rebase for setting this on a - per-branch basis. +pull.mode:: + When git pull is run, this determines if it would either merge or + rebase the fetched branch. The possible values are 'merge', + 'rebase', and 'rebase-preserve'. See branch.name.pullmode for doing + this in a non branch-specific manner. Add?: pull.rebase is deprecated. + - When preserve, also pass `--preserve-merges` along to 'git rebase' - so that locally committed merge commits will not be flattened - by running 'git pull'. + When 'rebase-preserve', also pass `--preserve-merges` along to + 'git rebase' so that locally committed merge commits will not be + flattened by running 'git pull'. + *NOTE*: this is a possibly dangerous operation; do *not* use it unless you understand the implications (see linkgit:git-rebase[1] diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index 200eb22..9a91b9f 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -117,7 +117,7 @@ locally created merge commits will not be flattened. + When false, merge the current branch into the upstream branch. + -See `pull.rebase`, `branch.name.rebase` and `branch.autosetuprebase` in +See `pull.mode`, `branch.name.pullmode` and `branch.autosetuprebase` in linkgit:git-config[1] if you want to make `git pull` always use `--rebase` instead of merging. + diff --git a/branch.c b/branch.c index 723a36b..63ce671 100644 --- a/branch.c +++ b/branch.c @@ -71,8 +71,8 @@ void install_branch_config(int flag, const char *local, const char *origin, cons if (rebasing) { strbuf_reset(key); - strbuf_addf(key,
Re: [PATCH v5 1/6] pull: rename pull.rename to pull.mode
Philip Oakley wrote: From: Felipe Contreras felipe.contre...@gmail.com Also 'branch.name.rebase' to 'branch.name.pullmode'. Sorry I haven't commented earlier. Because the 0/6 explanation isn't a commit, a few extra words would be useful to capture what the 0/6 cover letter said to start the patch series cleanly/clearly e.g. start with Begin the Reject non-ff pulls by default process by creating new config variables which will allow extra options, to replace the old pull configuration options. I didn't immediately grasp why the 'replacement' was happening, rather than it being a creation and a deprecation. How about this: This way 'pull.mode' can be set to 'merge', and the default can be something else. This will allow us to eventually add a 'merge-ff-only' option, and eventually set it as default to solve the problem of not rejecting non-ff pulls by default. The old configurations still work, but get deprecated. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -764,15 +764,15 @@ branch.name.mergeoptions:: option values containing whitespace characters are currently not supported. -branch.name.rebase:: - When true, rebase the branch name on top of the fetched branch, - instead of merging the default branch from the default remote when - git pull is run. See pull.rebase for doing this in a non - branch-specific manner. +branch.name.pullmode:: + When git pull is run, this determines if it would either merge or + rebase the fetched branch. The possible values are 'merge', + 'rebase', and 'rebase-preserve'. See pull.mode for doing this in a + non branch-specific manner. I'd think it useful to add that: branch.name.rebase is deprecated. given the large amount of internet cruft about this older config variable name I don't recall deprecated configurations in the documentation, but I don't see a problem adding that either. -- 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 v5 1/6] pull: rename pull.rename to pull.mode
From: Felipe Contreras felipe.contre...@gmail.com Philip Oakley wrote: From: Felipe Contreras felipe.contre...@gmail.com Also 'branch.name.rebase' to 'branch.name.pullmode'. Sorry I haven't commented earlier. Because the 0/6 explanation isn't a commit, a few extra words would be useful to capture what the 0/6 cover letter said to start the patch series cleanly/clearly e.g. start with Begin the Reject non-ff pulls by default process by creating new config variables which will allow extra options, to replace the old pull configuration options. I didn't immediately grasp why the 'replacement' was happening, rather than it being a creation and a deprecation. How about this: This way 'pull.mode' can be set to 'merge', and the default can be something else. My initial problem was the word sequence order which, in the original, started with the 'replace' statement, which tripped me up. So I was looking for some preparatory wording to set the scene and avoid the trip. (I'm assuming you were noting that you already had the subsequent This way 'pull.mode'.. statement, unfortunately I'd already tripped up by then in the original, hence the suggestions for the scene setting) This will allow us to eventually add a 'merge-ff-only' option, and eventually set it as default to solve the problem of not rejecting non-ff pulls by default. The old configurations still work, but get deprecated. Signed-off-by: Felipe Contreras felipe.contre...@gmail.com --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -764,15 +764,15 @@ branch.name.mergeoptions:: option values containing whitespace characters are currently not supported. -branch.name.rebase:: - When true, rebase the branch name on top of the fetched branch, - instead of merging the default branch from the default remote when - git pull is run. See pull.rebase for doing this in a non - branch-specific manner. +branch.name.pullmode:: + When git pull is run, this determines if it would either merge or + rebase the fetched branch. The possible values are 'merge', + 'rebase', and 'rebase-preserve'. See pull.mode for doing this in a + non branch-specific manner. I'd think it useful to add that: branch.name.rebase is deprecated. given the large amount of internet cruft about this older config variable name I don't recall deprecated configurations in the documentation, but I don't see a problem adding that either. I'm sure that Junio will be able to form an opinion, which could go either way. On the one hand we try to avoid endless deprecation notices that then never get removed. On the other, we have the internet advice to set those old variables, so its worth associating them with their newer replacement with the warning. It'll be some else's judgment call at the end of the day. -- Felipe Contreras -- Philip -- 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