Re: [Query] Separate hooks for Git worktrees

2017-11-12 Thread Viresh Kumar
On 10-11-17, 10:00, Stefan Beller wrote:
> Well it is the same project with different upstream workflows.
> For example I would imagine that Viresh wants to cherry-pick
> from one branch to another, or even send the same patch
> (just with different commit messages, with or without the
> ChangeId) to the different upstreams?

Right.

-- 
viresh


Re: [Query] Separate hooks for Git worktrees

2017-11-09 Thread Viresh Kumar
On 09-11-17, 11:14, Stefan Beller wrote:
> The proposed approach above might be hacky but sounds as if
> it should work?

Yeah its hacky for sure, but it solved my problem. Thanks for your
help Stefan :)

-- 
viresh


[Query] Separate hooks for Git worktrees

2017-11-09 Thread Viresh Kumar
Hi,

I have a typical use case, where I am using the same
repository for both Android and Linux kernel branches.

Android needs us to keep a special hook "commit-msg"
which adds a "Change-Id" to every commit we create.

While this works fine with Android, the behavior doesn't change
by simply changing to a upstream kernel branch and eventually
by mistake I may end up sending patch with Change-Id to upstream
kernel as well. And I want to avoid that.

I am looking at ways to make this configuration work for me by
applying the hook only for Android branches.

I tried using the "git worktrees" command to create a separate
linked tree for my android branch, but it doesn't have a .git directory
but just a file linking to the main repository.

Any idea how I can get around this problem without having separate
repositories for kernel and android ?

Thanks in advance.

--
viresh


Re: [PATCH] send-email: Add tocmd option to suppress-cc

2017-06-13 Thread Viresh Kumar
On 13-06-17, 10:23, Junio C Hamano wrote:
> Viresh Kumar <viresh.ku...@linaro.org> writes:
> 
> >> Going back to the core part of your change, i.e.
> >> 
> >> -  foreach my $entry (qw (cccmd cc author self sob body bodycc)) {
> >> +  foreach my $entry (qw (tocmd cccmd cc author self sob body bodycc)) {
> >> 
> >> to think about it a bit more, I notice that all the existing ones
> >> are about CC.  So I am not just not convinced that tocmd belongs to
> >> the same class.  I am inclined to say that it smells quite different
> >> from others.
> >
> > That's right but how do we solve this problem then?
> >
> > Add another optional argument like suppress-to ? I thought that it
> > would be better to override suppress-cc rather than attempting any
> > such thing.
> >
> > I am fine with any solution that address the concerns raised by this
> > patch though.
> 
> I am not sure what problem is being solved, quite honestly.  "I have
> tocmd configured and I want a way not to specify tocmd for a single
> invocation?"  Would something along the lines of 
> 
> git -c sendemail.tocmd=true send-email ...
> 
> how you do it in general?

Yeah, it works. I can use this instead.

This patch can be dropped now. Thanks.

-- 
viresh


Re: [PATCH] send-email: Add tocmd option to suppress-cc

2017-06-12 Thread Viresh Kumar
On 12-06-17, 11:04, Junio C Hamano wrote:
> Junio C Hamano <gits...@pobox.com> writes:
> 
> > Viresh Kumar <viresh.ku...@linaro.org> writes:
> >
> >> On 18-05-17, 17:05, Viresh Kumar wrote:
> >>> This adds tocmd option to suppress-cc command which already supports
> >>> cccmd and others.
> >>> 
> >>> Signed-off-by: Viresh Kumar <viresh.ku...@linaro.org>
> >>> ---
> >>>  Documentation/git-send-email.txt | 1 +
> >>>  git-send-email.perl  | 8 
> >>>  2 files changed, 5 insertions(+), 4 deletions(-)
> >>
> >> Ping !!
> >
> > Pong?
> >
> > I didn't get the impression that in the discussion that led to your
> > patch (or in any response to the patch) we established that it is a
> > good idea to change the behaviour of suppress-cc unconditionally
> > like this patch does.

Yeah, there were no conclusions there but we agreed that we have a
problem to solve. And this patch tried one of the ways.

> I think suppress-cc that suppresses cccmd output is very sensible
> (after all, it is about suppressing CC and cccmd is about producing
> CC), but I am not convinced that it is a good idea to suppress tocmd
> (which is about producing To) via suppress-cc.
> 
> Going back to the core part of your change, i.e.
> 
> - foreach my $entry (qw (cccmd cc author self sob body bodycc)) {
> + foreach my $entry (qw (tocmd cccmd cc author self sob body bodycc)) {
> 
> to think about it a bit more, I notice that all the existing ones
> are about CC.  So I am not just not convinced that tocmd belongs to
> the same class.  I am inclined to say that it smells quite different
> from others.

That's right but how do we solve this problem then?

Add another optional argument like suppress-to ? I thought that it
would be better to override suppress-cc rather than attempting any
such thing.

I am fine with any solution that address the concerns raised by this
patch though.

-- 
viresh


Re: [PATCH] send-email: Add tocmd option to suppress-cc

2017-06-11 Thread Viresh Kumar
On 18-05-17, 17:05, Viresh Kumar wrote:
> This adds tocmd option to suppress-cc command which already supports
> cccmd and others.
> 
> Signed-off-by: Viresh Kumar <viresh.ku...@linaro.org>
> ---
>  Documentation/git-send-email.txt | 1 +
>  git-send-email.perl  | 8 
>  2 files changed, 5 insertions(+), 4 deletions(-)

Ping !!

-- 
viresh


[PATCH] send-email: Add tocmd option to suppress-cc

2017-05-18 Thread Viresh Kumar
This adds tocmd option to suppress-cc command which already supports
cccmd and others.

Signed-off-by: Viresh Kumar <viresh.ku...@linaro.org>
---
 Documentation/git-send-email.txt | 1 +
 git-send-email.perl  | 8 
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 9d66166f69d9..f1634f7db3df 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -307,6 +307,7 @@ Automating
   patch body (commit message) except for self (use 'self' for that).
 - 'sob' will avoid including anyone mentioned in Signed-off-by lines except
for self (use 'self' for that).
+- 'tocmd' will avoid running the --to-cmd.
 - 'cccmd' will avoid running the --cc-cmd.
 - 'body' is equivalent to 'sob' + 'bodycc'
 - 'all' will suppress all auto cc values.
diff --git a/git-send-email.perl b/git-send-email.perl
index eea0a517f71b..cc3cd984aee4 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -85,7 +85,7 @@ git send-email --dump-aliases
 --identity* Use the sendemail. options.
 --to-cmd  * Email To: via ` \$patch_path`
 --cc-cmd  * Email Cc: via ` \$patch_path`
---suppress-cc * author, self, sob, cc, cccmd, body, 
bodycc, all.
+--suppress-cc * author, self, sob, cc, tocmd, cccmd, 
body, bodycc, all.
 --[no-]cc-cover* Email Cc: addresses in the cover letter.
 --[no-]to-cover* Email To: addresses in the cover letter.
 --[no-]signed-off-by-cc* Send to Signed-off-by: addresses. Default 
on.
@@ -435,13 +435,13 @@ my(%suppress_cc);
 if (@suppress_cc) {
foreach my $entry (@suppress_cc) {
die sprintf(__("Unknown --suppress-cc field: '%s'\n"), $entry)
-   unless $entry =~ 
/^(?:all|cccmd|cc|author|self|sob|body|bodycc)$/;
+   unless $entry =~ 
/^(?:all|tocmd|cccmd|cc|author|self|sob|body|bodycc)$/;
$suppress_cc{$entry} = 1;
}
 }
 
 if ($suppress_cc{'all'}) {
-   foreach my $entry (qw (cccmd cc author self sob body bodycc)) {
+   foreach my $entry (qw (tocmd cccmd cc author self sob body bodycc)) {
$suppress_cc{$entry} = 1;
}
delete $suppress_cc{'all'};
@@ -1582,7 +1582,7 @@ foreach my $t (@files) {
close $fh;
 
push @to, recipients_cmd("to-cmd", "to", $to_cmd, $t)
-   if defined $to_cmd;
+   if defined $to_cmd && !$suppress_cc{'tocmd'};
push @cc, recipients_cmd("cc-cmd", "cc", $cc_cmd, $t)
if defined $cc_cmd && !$suppress_cc{'cccmd'};
 
-- 
2.13.0.70.g636092d9



Re: [Query] Override sendemail.tocmd

2017-05-18 Thread Viresh Kumar
On 10 May 2017 at 12:53, Viresh Kumar <viresh.ku...@linaro.org> wrote:
> Hi,
>
> I have a use case and wanted help from you guys..
>
> I have set the sendemail.tocmd option in my kernel's .git/config
> file and that works very well. But sometimes I want to avoid that
> (for example sending the patch to someone without the list and
> maintainers).
>
> The suppress-cc=all option works quite well to avoid almost
> everything (including running --cc-cmd), but it doesn't suppress
> --to-cmd.
>
> Are there any specific reasons why it is being done that way?
>
> Currently I need to go edit my .git/config file and remove tocmd
> before sending any such patches and it sucks :)

Ping !!


Re: [Query] Override sendemail.tocmd

2017-05-10 Thread Viresh Kumar
On 10-05-17, 16:04, Viresh Kumar wrote:
> On 10-05-17, 12:18, Ævar Arnfjörð Bjarmason wrote:
> > On Wed, May 10, 2017 at 9:23 AM, Viresh Kumar <viresh.ku...@linaro.org> 
> > wrote:
> > > Hi,
> > >
> > > I have a use case and wanted help from you guys..
> > >
> > > I have set the sendemail.tocmd option in my kernel's .git/config
> > > file and that works very well. But sometimes I want to avoid that
> > > (for example sending the patch to someone without the list and
> > > maintainers).
> > >
> > > The suppress-cc=all option works quite well to avoid almost
> > > everything (including running --cc-cmd), but it doesn't suppress
> > > --to-cmd.
> > >
> > > Are there any specific reasons why it is being done that way?
> > >
> > > Currently I need to go edit my .git/config file and remove tocmd
> > > before sending any such patches and it sucks :)
> > 
> > Does something like this work:
> > 
> > git -c sendemail.tocmd=/bin/false send-email ...
> > 
> > ?
> 
> That failed. I tried with 2.12 version first and then on the next branch with
> version: 2.13.0.303.g4ebf3021692d
> 
> $ git -c sendemail.tocmd=/bin/false send-email --to vingu 0001-abc.patch
> 0001-abc.patch
> (mbox) Adding cc: Viresh Kumar <viresh.ku...@linaro.org> from line 'From: 
> Viresh Kumar <viresh.ku...@linaro.org>'
> (body) Adding cc: Viresh Kumar <viresh.ku...@linaro.org> from line 
> 'Signed-off-by: Viresh Kumar <viresh.ku...@linaro.org>'
> (to-cmd) failed to close pipe to '/bin/false' at 
> /usr/libexec/git-core/git-send-email line 1687.

And even if this worked, I believe that the right solution would be to fix
suppress-cc to include tocmd also. That's the whole purpose of suppress-cc
option.

-- 
viresh


Re: [Query] Override sendemail.tocmd

2017-05-10 Thread Viresh Kumar
On 10 May 2017 at 12:59, Viresh Kumar <viresh.ku...@linaro.org> wrote:
> On 10 May 2017 at 12:53, Viresh Kumar <viresh.ku...@linaro.org> wrote:
>> Hi,
>>
>> I have a use case and wanted help from you guys..
>>
>> I have set the sendemail.tocmd option in my kernel's .git/config
>> file and that works very well. But sometimes I want to avoid that
>> (for example sending the patch to someone without the list and
>> maintainers).
>>
>> The suppress-cc=all option works quite well to avoid almost
>> everything (including running --cc-cmd), but it doesn't suppress
>> --to-cmd.
>>
>> Are there any specific reasons why it is being done that way?
>>
>> Currently I need to go edit my .git/config file and remove tocmd
>> before sending any such patches and it sucks :)
>
> And it would be *really* useful if we can add the "review" (or whatever
> it is called) screen with suppress-cc command as well. Currently the mail
> goes away directly without giving us a chance to look at the final list of
> recipients the mail is going to :)

Fixed that with: sendemail.confirm = always


Re: [Query] Override sendemail.tocmd

2017-05-10 Thread Viresh Kumar
On 10-05-17, 12:18, Ævar Arnfjörð Bjarmason wrote:
> On Wed, May 10, 2017 at 9:23 AM, Viresh Kumar <viresh.ku...@linaro.org> wrote:
> > Hi,
> >
> > I have a use case and wanted help from you guys..
> >
> > I have set the sendemail.tocmd option in my kernel's .git/config
> > file and that works very well. But sometimes I want to avoid that
> > (for example sending the patch to someone without the list and
> > maintainers).
> >
> > The suppress-cc=all option works quite well to avoid almost
> > everything (including running --cc-cmd), but it doesn't suppress
> > --to-cmd.
> >
> > Are there any specific reasons why it is being done that way?
> >
> > Currently I need to go edit my .git/config file and remove tocmd
> > before sending any such patches and it sucks :)
> 
> Does something like this work:
> 
> git -c sendemail.tocmd=/bin/false send-email ...
> 
> ?

That failed. I tried with 2.12 version first and then on the next branch with
version: 2.13.0.303.g4ebf3021692d

$ git -c sendemail.tocmd=/bin/false send-email --to vingu 0001-abc.patch
0001-abc.patch
(mbox) Adding cc: Viresh Kumar <viresh.ku...@linaro.org> from line 'From: 
Viresh Kumar <viresh.ku...@linaro.org>'
(body) Adding cc: Viresh Kumar <viresh.ku...@linaro.org> from line 
'Signed-off-by: Viresh Kumar <viresh.ku...@linaro.org>'
(to-cmd) failed to close pipe to '/bin/false' at 
/usr/libexec/git-core/git-send-email line 1687.

-- 
viresh


Re: [Query] Override sendemail.tocmd

2017-05-10 Thread Viresh Kumar
On 10 May 2017 at 12:53, Viresh Kumar <viresh.ku...@linaro.org> wrote:
> Hi,
>
> I have a use case and wanted help from you guys..
>
> I have set the sendemail.tocmd option in my kernel's .git/config
> file and that works very well. But sometimes I want to avoid that
> (for example sending the patch to someone without the list and
> maintainers).
>
> The suppress-cc=all option works quite well to avoid almost
> everything (including running --cc-cmd), but it doesn't suppress
> --to-cmd.
>
> Are there any specific reasons why it is being done that way?
>
> Currently I need to go edit my .git/config file and remove tocmd
> before sending any such patches and it sucks :)

And it would be *really* useful if we can add the "review" (or whatever
it is called) screen with suppress-cc command as well. Currently the mail
goes away directly without giving us a chance to look at the final list of
recipients the mail is going to :)

--
viresh


[Query] Override sendemail.tocmd

2017-05-10 Thread Viresh Kumar
Hi,

I have a use case and wanted help from you guys..

I have set the sendemail.tocmd option in my kernel's .git/config
file and that works very well. But sometimes I want to avoid that
(for example sending the patch to someone without the list and
maintainers).

The suppress-cc=all option works quite well to avoid almost
everything (including running --cc-cmd), but it doesn't suppress
--to-cmd.

Are there any specific reasons why it is being done that way?

Currently I need to go edit my .git/config file and remove tocmd
before sending any such patches and it sucks :)

--
viresh


Re: Issues with cc-cmd

2016-02-15 Thread Viresh Kumar
On 15-02-16, 02:06, Junio C Hamano wrote:
> Viresh Kumar <viresh.ku...@linaro.org> writes:
> 
> > linux...@vger.kernel.org) (open list:OPERATING PERFORMANCE POINTS
> > (OPP),
> 
> Hmm
> 
> http://lists.kernelnewbies.org/pipermail/kernelnewbies/2014-July/011343.html
> 
> comes to mind.  It tells you not to blindly automate this process.
> 
> I do not offhand know if it was even designed to be directly used
> (and usable) as a cccmd, but anyway, I see this mention in its
> "Notes:" section:
> 
>   Using "--roles" or "--rolestats" with git send-email --cc-cmd or any
>   other automated tools that expect only ["name"] 
>   may not work because of additional output after .
> 
> I suspect that what you are showing is the "additional output after
> address" the above talks about.
> 
> In any case, this command is maintained as part of the kernel, no?
> I see Joe Perches signed at the beginning of file in 2007; I do not
> know if he still maintains this script, or somebody else is
> primarily enhancing it these days (ehh, I probably could use the
> script on itself, but I am way too lazy late at night), but asking
> him would be a good starting point, instead of asking here.

Yeah, he told me this sometime back and that solved the issues I was
facing, and in fact it looks far better now. Thanks Junio.

git send-email requires a simple list of names and addresses
without decorations like roles, commit stats or section names.

You are supposed to use something like:

tocmd = "scripts/get_maintainer.pl --nogit --nogit-fallback --norolestats 
--pattern-depth=1 --nol"
cccmd = "scripts/get_maintainer.pl --nogit --nogit-fallback --norolestats --nom 
--nor"

-- 
viresh
--
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


Issues with cc-cmd

2016-02-15 Thread Viresh Kumar
Hi Guys,

I am facing a strange issue with git send-email, with cccmd and was
looking for some help.

I am using it with Linux Kernel..

I used get-maintainers today to submit few patches for OPP framework
and that is defined as below in MAINTAINERS:

OPERATING PERFORMANCE POINTS (OPP)
M:  Viresh Kumar <vire...@kernel.org>
M:  Nishanth Menon <n...@ti.com>
M:  Stephen Boyd <sb...@codeaurora.org>
L:  linux...@vger.kernel.org
S:  Maintained
T:  git git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git
F:  drivers/base/power/opp/
F:  include/linux/pm_opp.h
F:  Documentation/power/opp.txt
F:  Documentation/devicetree/bindings/opp/


The parenthesis in the subsystem-name causes the cc list to look like:

Cc: linaro-ker...@lists.linaro.org,
linux...@vger.kernel.org,
Viresh Kumar <viresh.ku...@linaro.org>,
Krzysztof Kozlowski <k.kozlow...@samsung.com>,
Greg Kroah-Hartman <gre...@linuxfoundation.org>,
Len Brown <len.br...@intel.com>,
linux-ker...@vger.kernel.org (open list),
linux...@vger.kernel.org) (open list:OPERATING PERFORMANCE POINTS
(OPP),
Nishanth Menon <n...@ti.com>,
Pavel Machek <pa...@ucw.cz>,
Stephen Boyd <sb...@codeaurora.org>,
Viresh Kumar <vire...@kernel.org>


Look at the second linux-pm entry here, it adds a ')' at the end of
the list's address and removes it from the end of the line.

And so that becomes an invalid address to git-send-email.

Dropping () from the subsystem name fixes it though..

The output of get_maintainers looks fine, but when its being used by
putting following into .gitconfig:

[sendemail]
cccmd = scripts/get_maintainers


it doesn't work well..

-- 
viresh
--
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: [Query] Can we ignore case for commiters name in shortlog?

2012-11-30 Thread Viresh Kumar
On 30 November 2012 16:49, Max Horn m...@quendi.de wrote:
 I don't see how wrong case is different from any other form of misspelling. 
 And mailmap is there precisely to handle such problems. Now, if these case 
 issues were for some reasons very frequent, it might be worth adding 
 dedicated support for it. But this seems dubious to me -- do you have any 
 evidence for this? Indeed, do you have more than just the one example?

I don't have another example, but i have seen it many times. This happens
when people use different repo's to send patches and by mistake have mentioned
names in different case in them in their local .git/config files.

--
viresh
--
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


[Query] Can we ignore case for commiters name in shortlog?

2012-11-29 Thread viresh kumar
Hi Junio and others,

I have a query. git shortlog lists the patches submitted per commiter, like:

 Viresh Kumar (7):
   cpufreq: Improve debug prints
   cpufreq: return early from __cpufreq_driver_getavg()
   cpufreq: governors: remove redundant code
   cpufreq: Fix sparse warnings by updating cputime64_t to u64
   cpufreq: Fix sparse warning by making local function static
   cpufreq: Avoid calling cpufreq driver's target() routine if target_freq 
 == policy-cur
   cpufreq: Make sure target freq is within limits

 viresh kumar (3):
   cpufreq / core: Fix typo in comment describing show_bios_limit()
   cpufreq / core: Fix printing of governor and driver name
   cpufreq: Move common part from governors to separate file, v2

I know, there was something wrong at my end and i have commited stuff
with different cases.

I was just thinking if we can ignore case for commiter name while
listing stuff here?
So, that we get over any manual mistakes from commiter.

--
viresh
--
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: [Query] Can we ignore case for commiters name in shortlog?

2012-11-29 Thread Viresh Kumar
On 30 November 2012 08:54, David Aguilar dav...@gmail.com wrote:
 There's a feature that does exactly this.

 http://www.kernel.org/pub/software/scm/git/docs/git-shortlog.html

 See the section called Mapping Authors.
 It discusses the .mailmap file.

I have my name there :)

I thought using names with different case is actually different then misspelling
it. And so, everybody must not be required to update their names in mailmap
with different case. So, with same email id and same name (that may be in
different case), we can show commits together in shortlog.

--
viresh
--
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: [Query] Can we ignore case for commiters name in shortlog?

2012-11-29 Thread Viresh Kumar
On 30 November 2012 09:03, Nicolas Pitre nicolas.pi...@linaro.org wrote:

 Have a look at the .mailmap file in the top directory of your repo.

Repeating what i said to David in other mail:

I have my name there :)

I thought using names with different case is actually different then misspelling
it. And so, everybody must not be required to update their names in mailmap
with different case. So, with same email id and same name (that may be in
different case), we can show commits together in shortlog.

--
viresh
--
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