Re: [PATCH v3 6/7] rebase: write better reflog messages

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: >> @@ -59,6 +63,9 @@ else >> return $? >> fi >> >> + # always reset GIT_REFLOG_ACTION before calling any external >> + # scripts; they have no idea about our base_reflog_action >> + GIT_REFLOG_ACTION="$base_reflog_action" >> git am $git_am

Re: [PATCH 0/6] Reroll of rr/triangular-push-fix

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > [PATCH 3/6] push: change `simple` to accommodate triangular workflows > > Sqaushed in the fix to keep the semantics of "simple" when used in > the centralized workflow the same as before. Yeah, I'm worried about this as I pointed out earlier. I don't like erroring ou

Re: [PATCH 4/6] t/t5528-push-default: generalize test_push_*

2013-06-24 Thread Junio C Hamano
Johan Herland writes: >> + git --git-dir="${3:-repo1}" log -1 --format='%h %s' "$2" >actual && > > Isn't ${3:-repo1} a bashism? I do not think so. But now I looked at it again, I think I would use ${3-repo1} form in this case myself. No caller passes an empty string to the third place.

Re: [PATCH] Do not ignore merge options in interactive rebase

2013-06-24 Thread Arnaud Fontaine
Junio C Hamano writes: > Arnaud Fontaine writes: > >> Merge strategy and its options can be specified in `git rebase`, but >> with `--interactive`, they were completely ignored. > > And why is it a bad thing? If you meant s/--interactive/-m/ in the > above, then I can sort of understand the

Re: [PATCH 3/6] push: change `simple` to accommodate triangular workflows

2013-06-24 Thread Junio C Hamano
Johan Herland writes: >> +static void setup_push_current(struct remote *remote, struct branch *branch) >> +{ >> + if (!branch) >> + die(_(message_detached_head_die), remote->name); >> + add_refspec(branch->name); > > Here (and above) we add a refspec to tell Git exactly

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Junio C Hamano
Johan Herland writes: >> +static void setup_per_branch_push(struct branch *branch) >> +{ >> + struct strbuf refspec = STRBUF_INIT; >> + >> + strbuf_addf(&refspec, "%s:%s", >> + branch->name, branch->push_name); >> + add_refspec(refspec.buf); > > This goes back

[PATCH] Do not ignore merge options in interactive rebase

2013-06-24 Thread Arnaud Fontaine
Fix inconsistency where `--strategy` and/or `--strategy-option` can be specified in git rebase, but with `--interactive` argument only there were completely ignored. Signed-off-by: Arnaud Fontaine --- git-rebase--interactive.sh| 13 ++--- t/t3404-rebase-interactive.sh | 11 ++

Re: [PATCH 3/6] push: change `simple` to accommodate triangular workflows

2013-06-24 Thread Ramkumar Ramachandra
Johan Herland wrote: >> An earlier round of this change by mistake broke the safety for >> "simple" mode we have had since day 1 of that mode to make sure that >> the branch in the repository we update is set to be the one we fetch >> and integrate with, but it has been fixed. > > Shouldn't there b

Re: [PATCH v3 6/7] rebase: write better reflog messages

2013-06-24 Thread Junio C Hamano
Ramkumar Ramachandra writes: >>> + # always reset GIT_REFLOG_ACTION before calling any external >>> + # scripts; they have no idea about our base_reflog_action >>> + GIT_REFLOG_ACTION="$base_reflog_action" >>> git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" >> >> Why do

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > @@ -194,7 +203,14 @@ static int is_workflow_triagular(struct remote *remote) > static void setup_default_push_refspecs(struct remote *remote) > { > struct branch *branch = branch_get(NULL); > - int triangular = is_workflow_triagular(remote); > + int tri

Re: Message could not be delivered

2013-06-24 Thread Tiscalimail
To git@vger.kernel.org - git@vger.kernel.org, Your email message "Message could not be delivered" did not reach your recipient. Please click to confirm your message: http://www.tiscalimail.com/ Please vissit this link to find out more information: http://www.tiscalimail.com/ Thank you. --

Re: [PATCH 3/6] push: change `simple` to accommodate triangular workflows

2013-06-24 Thread Junio C Hamano
Johan Herland writes: >> An earlier round of this change by mistake broke the safety for >> "simple" mode we have had since day 1 of that mode to make sure that >> the branch in the repository we update is set to be the one we fetch >> and integrate with, but it has been fixed. > > Shouldn't ther

Re: [PATCH 0/6] Reroll of rr/triangular-push-fix

2013-06-24 Thread Junio C Hamano
Ramkumar Ramachandra writes: > I hope (perhaps foolishly) to persuade you nevertheless. I fear that > if this series solidifies before I get there, we'll be stuck with this > stupid erroring-out behavior forever. I do not think it is "stupid" at all. 'simple' is supposed to be an easy and safe

Re: [PATCH v3 6/7] rebase: write better reflog messages

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > So you are forcing people to maintain _two_ variables, instead of > just _one_, without making anything simpler. > > What's so hard to understand why it is a wrong design? Fine. Let's say I buy your argument about one-variable versus two-variables: how do you solve the exi

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Junio C Hamano wrote: >> @@ -194,7 +203,14 @@ static int is_workflow_triagular(struct remote *remote) >> static void setup_default_push_refspecs(struct remote *remote) >> { >> struct branch *branch = branch_get(NULL); >> - int triangular = is_workflo

Re: [PATCH 4/6] t/t5528-push-default: generalize test_push_*

2013-06-24 Thread Johan Herland
On Mon, Jun 24, 2013 at 9:28 AM, Junio C Hamano wrote: > Johan Herland writes: > >>> + git --git-dir="${3:-repo1}" log -1 --format='%h %s' "$2" >actual && >> >> Isn't ${3:-repo1} a bashism? > > I do not think so. But now I looked at it again, I think I would > use ${3-repo1} form in this

Re: [PATCH 4/6] t/t5528-push-default: generalize test_push_*

2013-06-24 Thread Eric Sunshine
On Mon, Jun 24, 2013 at 4:33 AM, Johan Herland wrote: > On Mon, Jun 24, 2013 at 9:28 AM, Junio C Hamano wrote: >> Johan Herland writes: >> + git --git-dir="${3:-repo1}" log -1 --format='%h %s' "$2" >actual && >>> >>> Isn't ${3:-repo1} a bashism? >> >> I do not think so. But now I lo

Re: [PATCH 3/6] push: change `simple` to accommodate triangular workflows

2013-06-24 Thread Johan Herland
On Mon, Jun 24, 2013 at 9:59 AM, Junio C Hamano wrote: > Johan Herland writes: >>> An earlier round of this change by mistake broke the safety for >>> "simple" mode we have had since day 1 of that mode to make sure that >>> the branch in the repository we update is set to be the one we fetch >>>

Re: [PATCH 3/6] push: change `simple` to accommodate triangular workflows

2013-06-24 Thread Johan Herland
On Mon, Jun 24, 2013 at 9:46 AM, Ramkumar Ramachandra wrote: > Johan Herland wrote: >>> +static void setup_push_current(struct remote *remote, struct branch >>> *branch) >>> +{ >>> + if (!branch) >>> + die(_(message_detached_head_die), remote->name); >>> + add_refspec(br

Re: [PATCH 4/6] t/t5528-push-default: generalize test_push_*

2013-06-24 Thread Johan Herland
On Mon, Jun 24, 2013 at 10:44 AM, Eric Sunshine wrote: > On Mon, Jun 24, 2013 at 4:33 AM, Johan Herland wrote: >> On Mon, Jun 24, 2013 at 9:28 AM, Junio C Hamano wrote: >>> Johan Herland writes: >>> > + git --git-dir="${3:-repo1}" log -1 --format='%h %s' "$2" >actual > && >>

Re: Splitting a rev list into 2 sets

2013-06-24 Thread Thomas Rast
Francis Moreau writes: > On Thu, Jun 20, 2013 at 3:20 PM, Thomas Rast wrote: >> positive=$(git rev-parse "$@" | grep -v '^\^') >> negative=$(git rev-parse "$@" | grep '^\^') >> boundary=$(git rev-list --boundary $positive ^master | sed -n 's/^-//p') >> # the intersection is >> git rev-

Re: detached HEAD before root commit - possible?

2013-06-24 Thread Matthieu Moy
SZEDER Gábor writes: > I suspect that detaching HEAD before a root commit is not possible by > design. What would HEAD contain then!? 'git checkout' seems to > corroborate: > > $ git init > Initialized empty Git repository in /tmp/test/.git/ > $ git checkout --detach > fatal: You are on a branc

[PATCH] documentation: add git transport security notice

2013-06-24 Thread Fraser Tweedale
The fact that the git transport has no end-to-end security is easily overlooked. Add a brief security notice to the "GIT URLS" section of the documentation stating that the git transport should be used with caution on unsecured networks. Signed-off-by: Fraser Tweedale --- Documentation/urls.txt

[PATCH] diff-options: document default similarity index

2013-06-24 Thread Fraser Tweedale
The default similarity index of 50% is documented in gitdiffcore(7) but it is worth also mentioning it in the description of the -M/--find-renames option. Signed-off-by: Fraser Tweedale --- Documentation/diff-options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documen

[PATCH] documentation: fix asterisks in fetch-options

2013-06-24 Thread Fraser Tweedale
Fix refspec asterisks in the -t/--tags section of the fetch-options documentation. Signed-off-by: Fraser Tweedale --- Documentation/fetch-options.txt | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt

Re: [PATCH] documentation: fix asterisks in fetch-options

2013-06-24 Thread Thomas Rast
Fraser Tweedale writes: > diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt > index 9cb6496..f2ac3bc 100644 > --- a/Documentation/fetch-options.txt > +++ b/Documentation/fetch-options.txt > @@ -61,11 +61,12 @@ endif::git-pull[] > ifndef::git-pull[] > -t:: > --tags:

Re: [PATCH] documentation: fix asterisks in fetch-options

2013-06-24 Thread Fraser Tweedale
Right you are. I missed that; apologies for the noise. Fraser On Mon, Jun 24, 2013 at 01:35:13PM +0200, Thomas Rast wrote: > Fraser Tweedale writes: > > > diff --git a/Documentation/fetch-options.txt > > b/Documentation/fetch-options.txt > > index 9cb6496..f2ac3bc 100644 > > --- a/Documentati

Re: git diff returns fatal error with core.safecrlf is set to true.

2013-06-24 Thread Yann Droneaud
Hi, Le 21.06.2013 23:57, Junio C Hamano a écrit : Junio C Hamano writes: The helper may want to learn a way to be told to demote that error to a warning. Perhaps something like this? Thanks for the patch. I run my test again, eg. run git diff after a rebase failure (see my other mail a

[PATCH (!) 0/2] Fix serious regressions in latest master

2013-06-24 Thread Ramkumar Ramachandra
Hi, It turns out that status.short and status.branch introduce two very serious regressions. This series fixes them. Thanks. Ramkumar Ramachandra (2): status: really ignore config with --porcelain commit: make it work with status.short builtin/commit.c | 8 +++- 1 file changed, 7 inse

[PATCH 2/2] commit: make it work with status.short

2013-06-24 Thread Ramkumar Ramachandra
50e4f75 (status: introduce status.short to enable --short by default, 2013-06-11) introduced a regression in git commit; it is now impossible to commit with status.short set. This happens because commit internally runs run_status() to set s->commitable and determine whether or not there is somethi

[PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Ramkumar Ramachandra
1a22bd3 (Merge branch 'jg/status-config', 2013-06-23) introduced a serious regression in --porcelain by introducing the configuration variables status.short and status.branch. Contrary to its description, the output of $ git status --porcelain now depends on the configuration variables status.

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Matthieu Moy
Ramkumar Ramachandra writes: > Contrary to its description, the output of > > $ git status --porcelain > > now depends on the configuration variables status.short and > status.branch. Ouch, indeed :-(. > The correct solution is therefore to skip the config parser completely > when --porcelain

Re: [PATCH 0/6] Reroll of rr/triangular-push-fix

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > 'simple' is supposed to be an easy and safe default to help new > people. Your original patch to change its semantics for the central > workflow from the current 'make sure upstream is set and set to the > same name' to 'anything goes' is making the mode more dangerous than

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Ramkumar Ramachandra
Matthieu Moy wrote: > [...] Before we begin, let me say that this series is written with the emergency-fix mindset, and targets maint. I didn't spend time thinking about how to do it best or even add tests. >> The correct solution is therefore to skip the config parser completely >> when --porce

Re: [PATCH 3/6] push: change `simple` to accommodate triangular workflows

2013-06-24 Thread Ramkumar Ramachandra
Johan Herland wrote: > But then, does it make sense to > say that we will only ever have exactly _one_ push refspec in the > current context, and we should therefore replace the "static const > char **refspec;" string array with a single "static const char > *refspec;" string? That would make it ob

Re: [PATCH] Do not ignore merge options in interactive rebase

2013-06-24 Thread Junio C Hamano
Arnaud Fontaine writes: >>> + $(echo $strategy_opts | sed "s/'--\([^']*\)'/-X\1/g") \ >> >> Is it guaranteed $startegy_opts do not have a space in it? > > strategy_opts may be something like (git-rebase.sh): "'--foo' '--bar'", > but I'm not sure what is wrong if there is a space

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: >> # on branch master, derived from origin >> $ git push ram >> >> And branch.master.push is set to next? Will you let her shoot herself >> in the foot like this? > > It is not shooting in the foot, if branch.master.push is explicitly > set to update next. I do not see a

Re: [PATCH/RFC 3/4] git-mw: Adding git-mw.perl script

2013-06-24 Thread Matthieu Moy
benoit.per...@ensimag.fr writes: > diff --git a/contrib/mw-to-git/git-mw.perl b/contrib/mw-to-git/git-mw.perl > new file mode 100644 > index 000..a2f0aa1 > --- /dev/null > +++ b/contrib/mw-to-git/git-mw.perl *.perl scripts are usually executable in Git's tree (although it's usually better to

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Junio C Hamano
Matthieu Moy writes: > I really don't like this. If we go for a solution looking explicitely at > argv[], we should at least iterate over it (also not satisfactory > because --porcelain could be the argument of another switch). Ram, thanks for a report. I won't comment on what is the correct wa

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Matthieu Moy
Ramkumar Ramachandra writes: > Matthieu Moy wrote: >> [...] > > Before we begin, let me say that this series is written with the > emergency-fix mindset, and targets maint. maint shouldn't be necessary since the breakage hasn't been released. At worse, we can revert the bad commits now and re-im

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Matthieu Moy
Junio C Hamano writes: > My knee-jerk reaction is that, because the > "--porcelain" output was designed to be extensible and scripts > reading from it is expected to ignore what it does not understand, > if the setting of status.branch is a problem, the reading side is > buggy and needs to be fix

Re: [PATCH 2/2] commit: make it work with status.short

2013-06-24 Thread Junio C Hamano
Ramkumar Ramachandra writes: > 50e4f75 (status: introduce status.short to enable --short by default, > 2013-06-11) introduced a regression in git commit; it is now impossible > to commit with status.short set. > > This happens because commit internally runs run_status() to set > s->commitable and

[PATCH v14 00/16] Interactive git-clean

2013-06-24 Thread Jiang Xin
Johannes found that some relative_path tests should be skipped on Windows. See this thread: http://thread.gmane.org/gmane.comp.version-control.git/227706 In this reroll, * I squash Johannes's patch into patch 01/16, and seven relative_path test cases are skipped by marking with POSIX. *

[PATCH v14 03/16] quote.c: remove path_relative, use relative_path instead

2013-06-24 Thread Jiang Xin
Since there is an enhanced version of relative_path() in path.c, remove duplicate counterpart path_relative() in quote.c. Signed-off-by: Jiang Xin Signed-off-by: Junio C Hamano --- quote.c | 55 ++- 1 file changed, 2 insertions(+), 53 deletion

[PATCH v14 01/16] test: add test cases for relative_path

2013-06-24 Thread Jiang Xin
Add subcommand "relative_path" in test-path-utils, and add test cases in t0060. Johannes tested this commit on Windows, and found that some relative_path tests should be skipped on Windows. This is because the bash on Windows rewrites arguments of regular Windows programs, such as git and the test

[PATCH v14 02/16] path.c: refactor relative_path(), not only strip prefix

2013-06-24 Thread Jiang Xin
Original design of relative_path() is simple, just strip the prefix (*base) from the absolute path (*abs). In most cases, we need a real relative path, such as: ../foo, ../../bar. That's why there is another reimplementation (path_relative()) in quote.c. Borrowed some codes from path_relative() in

[PATCH v14 04/16] Refactor quote_path_relative, remove unused params

2013-06-24 Thread Jiang Xin
After substitute path_relative() in quote.c with relative_path() from path.c, parameters (such as len and prefix_len) are obsolete in function quote_path_relative(). Remove unused parameters and change the order of parameters for quote_path_relative() function. Signed-off-by: Jiang Xin Signed-off

[PATCH v14 16/16] test: run testcases with POSIX absolute paths on Windows

2013-06-24 Thread Jiang Xin
Add new subcommand "mingw_path" in test-path-utils, so that we can get the expected absolute paths on Windows. For example: COMMAND LINELinux Windows == = === test-path-utils mingw_path // C:/msysgi

[PATCH v14 12/16] git-clean: add select by numbers interactive action

2013-06-24 Thread Jiang Xin
Draw a multiple choice menu using `list_and_choose` to select items to be deleted by numbers. User can input: * 1,5-7 : select 1,5,6,7 items to be deleted * * : select all items to be deleted * -*: unselect all, nothing will be deleted *: (empty) finish selecting, and retur

[PATCH v14 11/16] git-clean: add filter by pattern interactive action

2013-06-24 Thread Jiang Xin
Add a new action for interactive git-clean: filter by pattern. When the user chooses this action, user can input space-separated patterns (the same syntax as gitignore), and each clean candidate that matches with one of the patterns will be excluded from cleaning. When the user feels it's OK, press

[PATCH v14 14/16] git-clean: add documentation for interactive git-clean

2013-06-24 Thread Jiang Xin
Add new section "Interactive mode" for documentation of interactive git-clean. Signed-off-by: Jiang Xin Helped-by: Eric Sunshine Signed-off-by: Junio C Hamano --- Documentation/git-clean.txt | 65 +++-- 1 file changed, 63 insertions(+), 2 deletions(-) d

[PATCH v14 05/16] Refactor write_name_quoted_relative, remove unused params

2013-06-24 Thread Jiang Xin
After substitute path_relative() in quote.c with relative_path() from path.c, parameters (such as len and prefix_len) are obsolete in function write_name_quoted_relative(). Remove unused parameters from write_name_quoted_relative() and related functions. Signed-off-by: Jiang Xin Signed-off-by: Ju

[PATCH v14 08/16] git-clean: show items of del_list in columns

2013-06-24 Thread Jiang Xin
When there are lots of items to be cleaned, it is hard to see them all in one screen. Show them in columns will solve this problem. Signed-off-by: Jiang Xin Comments-by: Matthieu Moy Signed-off-by: Junio C Hamano --- Documentation/config.txt | 4 builtin/clean.c | 49 +++

[PATCH v14 09/16] git-clean: add colors to interactive git-clean

2013-06-24 Thread Jiang Xin
Show header, help, error messages, and prompt in colors for interactive git-clean. Re-use config variables, such as "color.interactive" and "color.interactive." for command `git-add--interactive`. Signed-off-by: Jiang Xin Comments-by: Matthieu Moy Signed-off-by: Junio C Hamano --- Documentatio

[PATCH v14 06/16] git-clean: refactor git-clean into two phases

2013-06-24 Thread Jiang Xin
Before introducing interactive git-clean, refactor git-clean operations into two phases: * hold cleaning items in del_list, * and remove them in a separate loop at the end. We will introduce interactive git-clean between the two phases. The interactive git-clean will show what would be done and

[PATCH v14 10/16] git-clean: use a git-add-interactive compatible UI

2013-06-24 Thread Jiang Xin
Rewrite menu using a new method `list_and_choose`, which is borrowed from `git-add--interactive.perl`. We will use this framework to add new actions for interactive git-clean later. Please NOTE: * Method `list_and_choose` return an array of integers, and * it is up to you to free the allocated

[PATCH v14 07/16] git-clean: add support for -i/--interactive

2013-06-24 Thread Jiang Xin
Show what would be done and the user must confirm before actually cleaning. Would remove ... Would remove ... Would remove ... Remove [y/n]? Press "y" to start cleaning, and press "n" if you want to abort. Signed-off-by: Jiang Xin Signed-off-by: Junio C Hamano --- Documentati

[PATCH v14 13/16] git-clean: add ask each interactive action

2013-06-24 Thread Jiang Xin
Add a new action for interactive git-clean: ask each. It's just like the "rm -i" command, that the user must confirm one by one for each file or directory to be cleaned. Signed-off-by: Jiang Xin Signed-off-by: Junio C Hamano --- builtin/clean.c | 36 1 file

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Johan Herland
On Mon, Jun 24, 2013 at 4:19 PM, Ramkumar Ramachandra wrote: > Junio C Hamano wrote: >>> # on branch master, derived from origin >>> $ git push ram >>> >>> And branch.master.push is set to next? Will you let her shoot herself >>> in the foot like this? >> >> It is not shooting in the foot, if

[PATCH v14 15/16] test: add t7301 for git-clean--interactive

2013-06-24 Thread Jiang Xin
Add test cases for git-clean--interactive. Signed-off-by: Jiang Xin Signed-off-by: Junio C Hamano --- t/t7301-clean-interactive.sh | 439 +++ 1 file changed, 439 insertions(+) create mode 100755 t/t7301-clean-interactive.sh diff --git a/t/t7301-clean-in

Re: [PATCH 2/2] commit: make it work with status.short

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > As I said in the other message, I'll revert the merge of the topic > branch from 'master' for now, and queue this on top of the topic so > that we will have the preventive fix when the topic is in a better > shape for the other possible breakage on the "--branch" thing. Tha

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Junio C Hamano wrote: >>> # on branch master, derived from origin >>> $ git push ram >>> >>> And branch.master.push is set to next? Will you let her shoot herself >>> in the foot like this? >> >> It is not shooting in the foot, if branch.master.push is explicit

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > Configuration related to the output format (like color=always) must > be ignored under "--porcelain", but if we do not read core-ish > configuration variables (e.g. core.crlf) that affect the logic to > list what is changed what is not, we would not give the right > result,

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Junio C Hamano
Johan Herland writes: > I haven't yet dug deep enough to figure out an obvious failure mode > (and I probably should not have sent this email until I'd found one), > but I wonder if we'd be better off forcing the $remote and $remote_ref > configuration for a given branch to appear as more of a si

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > If the user said "git push" without an explicit request to push to > "ram", and if branch.master.pushremote was not set to "ram", and > still the command "git push" pushed the branch to "ram", then I > would understand what you are worried about, but otherwise I do not > see

Re: [PATCH 1/4] t9903: add tests for git-prompt pcmode

2013-06-24 Thread SZEDER Gábor
On Sat, Jun 22, 2013 at 01:32:38PM -0300, Eduardo D'Avila wrote: > These tests where important to make sure that I wouldn't break anything during > the refactorization. Having them pass before *and* after refactorization > guarantees that nothing was broken (except for some subtle case that might

Re: [PATCH] documentation: add git transport security notice

2013-06-24 Thread Junio C Hamano
Fraser Tweedale writes: > The fact that the git transport has no end-to-end security is easily > overlooked. Add a brief security notice to the "GIT URLS" section > of the documentation stating that the git transport should be used > with caution on unsecured networks. > > Signed-off-by: Fraser

Re: [PATCH] diff-options: document default similarity index

2013-06-24 Thread Ramkumar Ramachandra
Fraser Tweedale wrote: > The default similarity index of 50% is documented in gitdiffcore(7) > but it is worth also mentioning it in the description of the > -M/--find-renames option. Looks good from a quick look at diffcore.h: #define DEFAULT_RENAME_SCORE 3 /* rename/copy similarity minimum

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Junio C Hamano
Matthieu Moy writes: >> Basically, having the CLI parser and the config parser flip two >> different sets of variables, so we can discriminate who set what. >> What annoys me is that this is the first instance of such a >> requirement. > > I don't think it's the first instance, but I can't rememb

Another core.safecrlf behavor with git diff/git status

2013-06-24 Thread Yann Droneaud
Hi, I'm still trying to use .gitattributes "text" flag with CRLF line ending files under Linux. I'm surprised about the interaction between the index and the working directory, more specificaly about the interaction between git diff and git status: $ git init Initialized empty Git repos

Re: [PATCH/RFC 3/4] git-mw: Adding git-mw.perl script

2013-06-24 Thread Junio C Hamano
Matthieu Moy writes: > benoit.per...@ensimag.fr writes: > >> diff --git a/contrib/mw-to-git/git-mw.perl b/contrib/mw-to-git/git-mw.perl >> new file mode 100644 >> index 000..a2f0aa1 >> --- /dev/null >> +++ b/contrib/mw-to-git/git-mw.perl > > *.perl scripts are usually executable in Git's tree

[PATCHv3 01/16] bash prompt: fix redirection coding style in tests

2013-06-24 Thread SZEDER Gábor
Use '>file' instead of '> file', in accordance with the coding guidelines. Signed-off-by: SZEDER Gábor --- t/t9903-bash-prompt.sh | 232 - 1 file changed, 116 insertions(+), 116 deletions(-) diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-promp

[PATCHv3 00/16] bash prompt speedup

2013-06-24 Thread SZEDER Gábor
Hi, displaying the git-specific bash prompt on Windows/MinGW takes quite long, long enough to be noticeable. This is mainly caused by the numerous fork()s and exec()s to create subshells and run git or other commands, which are rather expensive on Windows. This patch series eliminates many comma

[PATCHv3 03/16] completion, bash prompt: move __gitdir() tests to completion test suite

2013-06-24 Thread SZEDER Gábor
Currently __gitdir() is duplicated in the git completion and prompt scripts, while its tests are in the prompt test suite. This patch series is about to change __git_ps1() in a way that it won't need __gitdir() anymore and __gitdir() will be removed from the prompt script. So move all __gitdir()

[PATCHv3 04/16] bash prompt: add a test for symbolic link symbolic refs

2013-06-24 Thread SZEDER Gábor
Signed-off-by: SZEDER Gábor --- t/t9903-bash-prompt.sh | 9 + 1 file changed, 9 insertions(+) diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh index df36239a..416e6219 100755 --- a/t/t9903-bash-prompt.sh +++ b/t/t9903-bash-prompt.sh @@ -40,6 +40,15 @@ test_expect_success 'pro

[PATCHv3 05/16] bash prompt: print unique detached HEAD abbreviated object name

2013-06-24 Thread SZEDER Gábor
When describing a detached HEAD according to the $GIT_PS1_DESCRIBE environment variable fails, __git_ps1() runs 'cut -c1-7 .git/HEAD' to show the 7 hexdigits abbreviated commit object name in the prompt. Obviously, this neither respects core.abbrev nor produces a unique object name. Fix this by us

[PATCHv3 02/16] bash prompt: use 'write_script' helper in interactive rebase test

2013-06-24 Thread SZEDER Gábor
Helped-by: Jeff King Signed-off-by: SZEDER Gábor --- t/t9903-bash-prompt.sh | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh index 7c7f8b97..442b9a20 100755 --- a/t/t9903-bash-prompt.sh +++ b/t/t9903-bash-prompt.sh @

Re: Another core.safecrlf behavor with git diff/git status

2013-06-24 Thread Yann Droneaud
Le 24.06.2013 18:37, Yann Droneaud a écrit : I'm still trying to use .gitattributes "text" flag with CRLF line ending files under Linux. I'm surprised about the interaction between the index and the working directory, more specificaly about the interaction between git diff and git status:

[PATCHv3 07/16] bash prompt: run 'git rev-parse --git-dir' directly instead of __gitdir()

2013-06-24 Thread SZEDER Gábor
__git_ps1() finds out the path to the repository by using the __gitdir() helper function. __gitdir() is basically just a wrapper around 'git rev-parse --git-dir', extended with support for recognizing a remote repository given as argument, to use the path given on the command line, and with a few

[PATCHv3 06/16] bash prompt: return early from __git_ps1() when not in a git repository

2013-06-24 Thread SZEDER Gábor
... to gain one level of indentation for the bulk of the function. (The patch looks quite unreadable, you'd better check it with 'git diff -w'.) Signed-off-by: SZEDER Gábor --- contrib/completion/git-prompt.sh | 201 --- 1 file changed, 101 insertions(+), 100

[PATCHv3 09/16] bash prompt: use bash builtins to find out current branch

2013-06-24 Thread SZEDER Gábor
__git_ps1() runs the '$(git symbolic-ref HEAD)' command substitution to find out whether we are on a branch and to find out the name of that branch. This imposes the overhead of fork()ing a subshell and fork()+exec()ing a git process. Since HEAD is in most cases a single-line file and the symboli

[PATCHv3 08/16] bash prompt: use bash builtins to find out rebase state

2013-06-24 Thread SZEDER Gábor
During an ongoing interactive rebase __git_ps1() finds out the name of the rebased branch, the total number of patches and the number of the current patch by executing a '$(cat .git/rebase-merge/)' command substitution for each. That is not quite the most efficient way to read single line single w

[PATCHv3 10/16] bash prompt: combine 'git rev-parse' executions in the main code path

2013-06-24 Thread SZEDER Gábor
There are a couple of '$(git rev-parse --)' command substitutions in __git_ps1() and three of them are executed in the main code path: - the first to get the path to the .git directory ('--git-dir'), - the second to check whether we're inside the .git directory ('--is-inside-git-dir'), - and

[PATCHv3 12/16] bash prompt: use bash builtins to check for unborn branch for dirty state

2013-06-24 Thread SZEDER Gábor
When the dirty work tree and index status indicator is enabled, __git_ps1() checks for changes in the index by running 'git diff-index --cached --quiet HEAD --' and looking at its exit code. However, that makes sense only when HEAD points to a valid commit: on an unborn branch the failure of said

[PATCHv3 11/16] bash prompt: combine 'git rev-parse' for detached head

2013-06-24 Thread SZEDER Gábor
When describing a detached HEAD according to the $GIT_PS1_DESCRIBE environment variable fails, __git_ps1() now runs the '$(git rev-parse --short HEAD)' command substitution to get the abbreviated detached HEAD commit object name. This imposes the overhead of fork()ing a subshell and fork()+exec()i

[PATCHv3 14/16] bash prompt: avoid command substitution when checking for untracked files

2013-06-24 Thread SZEDER Gábor
When enabled, the bash prompt can indicate the presence of untracked files with a '%' sign. __git_ps1() checks for untracked files by running the '$(git ls-files --others --exclude-standard)' command substitution, and displays the indicator when there is no output. Avoid this command substitution

[PATCHv3 13/16] bash prompt: use bash builtins to check stash state

2013-06-24 Thread SZEDER Gábor
When the environment variable $GIT_PS1_SHOWSTASHSTATE is set __git_ps1() checks the presence of stashes by running 'git rev-parse --verify refs/stash'. This command not only checks that the 'refs/stash' ref exists but also, well, verifies that it's a valid ref. However, we don't need to be that t

[PATCHv3 15/16] bash prompt: avoid command substitution when finalizing gitstring

2013-06-24 Thread SZEDER Gábor
Before setting $PS1, __git_ps1() uses a command substitution to redirect the output from a printf into a variable. Spare the overhead of fork()ing a subshell by using 'printf -v ' to directly assign the output to that variable. zsh's printf doesn't support the '-v ' option, so stick with the comm

[PATCHv3 16/16] bash prompt: mention that PROMPT_COMMAND mode is faster

2013-06-24 Thread SZEDER Gábor
__git_ps1() is usually added to the prompt inside a command substitution, imposing the overhead of fork()ing a subshell. Using __git_ps1() for $PROMPT_COMMAND is slightly faster, because it avoids that command substitution. Mention this in the comments about setting up the git prompt. The whole

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Matthieu Moy
Junio C Hamano writes: > Matthieu Moy writes: > >>> Basically, having the CLI parser and the config parser flip two >>> different sets of variables, so we can discriminate who set what. >>> What annoys me is that this is the first instance of such a >>> requirement. >> >> I don't think it's the

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Junio C Hamano
Ramkumar Ramachandra writes: > Junio C Hamano wrote: >> If the user said "git push" without an explicit request to push to >> "ram", and if branch.master.pushremote was not set to "ram", and >> still the command "git push" pushed the branch to "ram", then I >> would understand what you are worrie

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > In any case, I am still not convinced yet that status.short is a > real problem if --porcelain readers trip with "## branchname" > output. Isn't it that the readers are broken and need fixing? If you're going to read the configuration and then scramble to reset it in wt_po

Re: Another core.safecrlf behavor with git diff/git status

2013-06-24 Thread Junio C Hamano
Yann Droneaud writes: > - Why git diff does not always report the CRLF/LF mismatch ? Most likely because you are telling safecrlf not to error out but just warn, and then you are not fixing the cause of the warning? So diff would say "Ok, you must know what you are doing, so I trust what is in

Re: [PATCH/RFC 3/4] git-mw: Adding git-mw.perl script

2013-06-24 Thread Matthieu Moy
Junio C Hamano writes: > Matthieu Moy writes: > >> benoit.per...@ensimag.fr writes: >> >>> diff --git a/contrib/mw-to-git/git-mw.perl b/contrib/mw-to-git/git-mw.perl >>> new file mode 100644 >>> index 000..a2f0aa1 >>> --- /dev/null >>> +++ b/contrib/mw-to-git/git-mw.perl >> >> *.perl scripts

Re: [PATCH/RFC 3/4] git-mw: Adding git-mw.perl script

2013-06-24 Thread Jeff King
On Mon, Jun 24, 2013 at 06:56:17PM +0200, Matthieu Moy wrote: > > Good eyes. But if we encourage people to run non-*.perl version, > > perhaps we should drop the executable bit from the source, no? > > But by default, I'd say consistency is most important so if other *.perl > are executable, we

Re: Another core.safecrlf behavor with git diff/git status

2013-06-24 Thread Yann Droneaud
Le 24.06.2013 18:37, Yann Droneaud a écrit : I'm still trying to use .gitattributes "text" flag with CRLF line ending files under Linux. I'm surprised about the interaction between the index and the working directory, more specificaly about the interaction between git diff and git status:

Re: [PATCH/RFC 3/4] git-mw: Adding git-mw.perl script

2013-06-24 Thread Benoit Person
Le 2013-06-24 18:56, Matthieu Moy a écrit : Junio C Hamano writes: Matthieu Moy writes: benoit.per...@ensimag.fr writes: diff --git a/contrib/mw-to-git/git-mw.perl b/contrib/mw-to-git/git-mw.perl new file mode 100644 index 000..a2f0aa1 --- /dev/null +++ b/contrib/mw-to-git/git-mw.per

Re: [PATCH 6/6] push: honor branch.*.push

2013-06-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote: > If you do not set anywhere (like branch.master.pushremote or > remote.pushdefault) to push to "ram", and if you did not say "git > push ram" but just said "git push", we will not push to "ram" > (otherwise it is broken). So if the push is going to "ram", the > user must hav

Re: [PATCH 1/2] status: really ignore config with --porcelain

2013-06-24 Thread Junio C Hamano
Matthieu Moy writes: > Scripts that want the branch information can use --branch. > Scripts that do not have absolutely nothing to gain in getting this > extra output (only extra parser complexity). OK, I could buy that. I personally have always _assumed_ that the way the "--porcelain" output w

Re: [PATCH 4/6] t/t5528-push-default: generalize test_push_*

2013-06-24 Thread Junio C Hamano
Junio C Hamano writes: > Johan Herland writes: > >>> + git --git-dir="${3:-repo1}" log -1 --format='%h %s' "$2" >actual && >> >> Isn't ${3:-repo1} a bashism? > > I do not think so. But now I looked at it again, I think I would > use ${3-repo1} form in this case myself. No caller passes

  1   2   >