git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to force a commit date matching info from a mbox ?
@ 2009-01-22 22:41 Christian MICHON
  2009-01-23  0:14 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Christian MICHON @ 2009-01-22 22:41 UTC (permalink / raw)
  To: git list

Hi list,

I've a big set of patches in a mbox file: there's sufficient info
inside for git-am to work.

Yet, each time I do import these, my sha1sums are changing because of
different commit dates.

I'd like to force the commit date to match the info/date from the time
I received the email (and therefore always get back the right
sha1sums).

is this possible ?

There's hundreds of these patches: I'm looking for the right switch or
1 liner trick instead of a long shell script which will import 1 by 1
the patches and force the commit date by environment.

TIA

-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-22 22:41 how to force a commit date matching info from a mbox ? Christian MICHON
@ 2009-01-23  0:14 ` Junio C Hamano
  2009-01-23  8:08   ` Christian MICHON
  2009-01-23  0:21 ` Johannes Schindelin
  2009-01-23  0:45 ` Nanako Shiraishi
  2 siblings, 1 reply; 19+ messages in thread
From: Junio C Hamano @ 2009-01-23  0:14 UTC (permalink / raw)
  To: Christian MICHON; +Cc: git list

Christian MICHON <christian.michon@gmail.com> writes:

> I'd like to force the commit date to match the info/date from the time
> I received the email (and therefore always get back the right
> sha1sums).
>
> is this possible ?

"am" being a tool to accept patches written in some past to faithfully
record both author timestamp and committer timestamp, what you seem to
want is outside of the current scope of the tool.

A patch to butcher "git-am" to copy GIT_COMMITTER_DATE from
GIT_AUTHOR_DATE and export it should be trivial to implement, though.

Perhaps something like this totally untested patch.



 git-am.sh     |   13 ++++++++++++-
 t/t4150-am.sh |   20 ++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletions(-)

diff --git c/git-am.sh w/git-am.sh
index e20dd88..e96071d 100755
--- c/git-am.sh
+++ w/git-am.sh
@@ -23,6 +23,7 @@ resolvemsg=     override error message when patch failure occurs
 r,resolved      to be used after a patch failure
 skip            skip the current patch
 abort           restore the original branch and abort the patching operation.
+committer-date-is-author-date    lie about committer date
 rebasing        (internal use for git-rebase)"
 
 . git-sh-setup
@@ -133,6 +134,7 @@ dotest="$GIT_DIR/rebase-apply"
 sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
 resolvemsg= resume=
 git_apply_opt=
+committer_date_is_author_date=
 
 while test $# != 0
 do
@@ -168,6 +170,8 @@ do
 		git_apply_opt="$git_apply_opt $(sq "$1=$2")"; shift ;;
 	-C|-p)
 		git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;;
+	--committer-date-is-author-date)
+		committer_date_is_author_date=t ;;
 	--)
 		shift; break ;;
 	*)
@@ -521,7 +525,14 @@ do
 
 	tree=$(git write-tree) &&
 	parent=$(git rev-parse --verify HEAD) &&
-	commit=$(git commit-tree $tree -p $parent <"$dotest/final-commit") &&
+	commit=$(
+		if test -n "$committer_date_is_author_date"
+		then
+			GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
+			export GIT_COMMITTER_DATE
+		fi &&
+		git commit-tree $tree -p $parent <"$dotest/final-commit"
+	) &&
 	git update-ref -m "$GIT_REFLOG_ACTION: $FIRSTLINE" HEAD $commit $parent ||
 	stop_here $this
 
diff --git c/t/t4150-am.sh w/t/t4150-am.sh
index 796f795..8d3fb00 100755
--- c/t/t4150-am.sh
+++ w/t/t4150-am.sh
@@ -257,4 +257,24 @@ test_expect_success 'am works from file (absolute path given) in subdirectory' '
 	test -z "$(git diff second)"
 '
 
+test_expect_success 'am --committer-date-is-author-date' '
+	git checkout first &&
+	test_tick &&
+	git am --committer-date-is-author-date patch1 &&
+	git cat-file commit HEAD | sed -e "/^$/q" >head1 &&
+	at=$(sed -ne "/^author /s/.*> //p" head1) &&
+	ct=$(sed -ne "/^committer /s/.*> //p" head1) &&
+	test "$at" = "$ct"
+'
+
+test_expect_success 'am without --committer-date-is-author-date' '
+	git checkout first &&
+	test_tick &&
+	git am patch1 &&
+	git cat-file commit HEAD | sed -e "/^$/q" >head1 &&
+	at=$(sed -ne "/^author /s/.*> //p" head1) &&
+	ct=$(sed -ne "/^committer /s/.*> //p" head1) &&
+	test "$at" != "$ct"
+'
+
 test_done

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-22 22:41 how to force a commit date matching info from a mbox ? Christian MICHON
  2009-01-23  0:14 ` Junio C Hamano
@ 2009-01-23  0:21 ` Johannes Schindelin
  2009-01-23  8:07   ` Christian MICHON
  2009-01-23  0:45 ` Nanako Shiraishi
  2 siblings, 1 reply; 19+ messages in thread
From: Johannes Schindelin @ 2009-01-23  0:21 UTC (permalink / raw)
  To: Christian MICHON; +Cc: git list

Hi,

On Thu, 22 Jan 2009, Christian MICHON wrote:

> I've a big set of patches in a mbox file: there's sufficient info inside 
> for git-am to work.
> 
> Yet, each time I do import these, my sha1sums are changing because of 
> different commit dates.
> 
> I'd like to force the commit date to match the info/date from the time I 
> received the email (and therefore always get back the right sha1sums).
> 
> is this possible ?

Have you tried setting GIT_COMMITTER_DATE to the given date?

Alternatively, you can always use a commit-message filter with 
filter-branch to fix it up.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-22 22:41 how to force a commit date matching info from a mbox ? Christian MICHON
  2009-01-23  0:14 ` Junio C Hamano
  2009-01-23  0:21 ` Johannes Schindelin
@ 2009-01-23  0:45 ` Nanako Shiraishi
  2009-01-23  7:37   ` Junio C Hamano
  2009-01-23  8:26   ` Nanako Shiraishi
  2 siblings, 2 replies; 19+ messages in thread
From: Nanako Shiraishi @ 2009-01-23  0:45 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git list, Christian MICHON

Quoting Junio C Hamano <gitster@pobox.com>:

> Christian MICHON <christian.michon@gmail.com> writes:
>
>> I'd like to force the commit date to match the info/date from the time
>> I received the email (and therefore always get back the right
>> sha1sums).
>>
>> is this possible ?
>
> "am" being a tool to accept patches written in some past to faithfully
> record both author timestamp and committer timestamp, what you seem to
> want is outside of the current scope of the tool.
>
> A patch to butcher "git-am" to copy GIT_COMMITTER_DATE from
> GIT_AUTHOR_DATE and export it should be trivial to implement, though.
>
> Perhaps something like this totally untested patch.

You have test scripts already, but you say it is untested?

I often wanted to have an opposite of what Christian wants. I always have some changes I am holding off, and when I decide to trickle them out to the main repository, I do not want the resulting commit to carry old dates that are recorded in the format-patch output. Instead I want to pretend that I worked on them today. Is this something you can teach git-am and git-rebase to do easily?

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23  0:45 ` Nanako Shiraishi
@ 2009-01-23  7:37   ` Junio C Hamano
  2009-01-23  8:26   ` Nanako Shiraishi
  1 sibling, 0 replies; 19+ messages in thread
From: Junio C Hamano @ 2009-01-23  7:37 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: git list, Christian MICHON

Nanako Shiraishi <nanako3@lavabit.com> writes:

> Quoting Junio C Hamano <gitster@pobox.com>:
>
>> Perhaps something like this totally untested patch.
>
> You have test scripts already, but you say it is untested?

Correct.  I did not run that new test, let alone existing ones ;-)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23  0:21 ` Johannes Schindelin
@ 2009-01-23  8:07   ` Christian MICHON
  0 siblings, 0 replies; 19+ messages in thread
From: Christian MICHON @ 2009-01-23  8:07 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git list

On Fri, Jan 23, 2009 at 1:21 AM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Thu, 22 Jan 2009, Christian MICHON wrote:
>
>> I've a big set of patches in a mbox file: there's sufficient info inside
>> for git-am to work.
>>
>> Yet, each time I do import these, my sha1sums are changing because of
>> different commit dates.
>>
>> I'd like to force the commit date to match the info/date from the time I
>> received the email (and therefore always get back the right sha1sums).
>>
>> is this possible ?
>
> Have you tried setting GIT_COMMITTER_DATE to the given date?

yes, I did. This is what I want to change: I can fix the same
GIT_COMMITTER_DATE for all patches in the mbox, but I really want +
                   GIT_COMMITTER_DATE=GIT_AUTHOR_DATE


>
> Alternatively, you can always use a commit-message filter with
> filter-branch to fix it up.
>
> Ciao,
> Dscho
>

I'm curious if this could be done: the problem I quickly faced was
that this approach would double the amount of commits.

So I'm eager to test Junio's patch :)

-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23  0:14 ` Junio C Hamano
@ 2009-01-23  8:08   ` Christian MICHON
  2009-01-23  8:51     ` Christian MICHON
  0 siblings, 1 reply; 19+ messages in thread
From: Christian MICHON @ 2009-01-23  8:08 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git list

On Fri, Jan 23, 2009 at 1:14 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Christian MICHON <christian.michon@gmail.com> writes:
>
>> I'd like to force the commit date to match the info/date from the time
>> I received the email (and therefore always get back the right
>> sha1sums).
>>
>> is this possible ?
>
> "am" being a tool to accept patches written in some past to faithfully
> record both author timestamp and committer timestamp, what you seem to
> want is outside of the current scope of the tool.
>
> A patch to butcher "git-am" to copy GIT_COMMITTER_DATE from
> GIT_AUTHOR_DATE and export it should be trivial to implement, though.
>
> Perhaps something like this totally untested patch.
>

I love this idea. I'll try to test it asap. Thanks!

-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23  0:45 ` Nanako Shiraishi
  2009-01-23  7:37   ` Junio C Hamano
@ 2009-01-23  8:26   ` Nanako Shiraishi
  2009-01-23  9:39     ` Junio C Hamano
                       ` (2 more replies)
  1 sibling, 3 replies; 19+ messages in thread
From: Nanako Shiraishi @ 2009-01-23  8:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git list, Christian MICHON

Quoting Junio C Hamano <gitster@pobox.com>:

> Nanako Shiraishi <nanako3@lavabit.com> writes:
>
>> Quoting Junio C Hamano <gitster@pobox.com>:
>>
>>> Perhaps something like this totally untested patch.
>>
>> You have test scripts already, but you say it is untested?
>
> Correct.  I did not run that new test, let alone existing ones ;-)

I applied your patch and run the test suite, including the new one, and they passed.

I tried to write a new option I said that I wanted in my previous message.  Here is a patch.

--->8---
Subject: [PATCH] git-am: Add --ignore-date option

This new option makes the command ignore the date header field recorded in
the format-patch output.  The commits will have the timestamp when they
are created instead.

You can work a lot in one day to accumulate many changes, but apply and
push to the public repository only some of them at the end of the first
day.  Then next day you can spend all your working hours reading comics or
chatting with your coworkers, and apply your remaining patches from the
previous day using this option to pretend that you have been working at
the end of the day.

Signed-off-by: しらいしななこ <nanako3@lavabit.com>
---
 git-am.sh     |   12 +++++++++++-
 t/t4150-am.sh |    9 +++++++++
 2 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index e96071d..eb88d90 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -24,6 +24,7 @@ r,resolved      to be used after a patch failure
 skip            skip the current patch
 abort           restore the original branch and abort the patching operation.
 committer-date-is-author-date    lie about committer date
+ignore-date     use current timestamp for author date
 rebasing        (internal use for git-rebase)"
 
 . git-sh-setup
@@ -135,6 +136,7 @@ sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
 resolvemsg= resume=
 git_apply_opt=
 committer_date_is_author_date=
+ignore_date=
 
 while test $# != 0
 do
@@ -172,6 +174,8 @@ do
 		git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;;
 	--committer-date-is-author-date)
 		committer_date_is_author_date=t ;;
+	--ignore-date)
+		ignore_date=t ;;
 	--)
 		shift; break ;;
 	*)
@@ -379,7 +383,13 @@ do
 
 	GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
 	GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
-	GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
+	case "$ignore_date" in
+	    t)
+		GIT_AUTHOR_DATE="$(date -R)"
+		;;
+	    '')
+		GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
+	esac
 
 	if test -z "$GIT_AUTHOR_EMAIL"
 	then
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 8d3fb00..5ecf456 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -277,4 +277,13 @@ test_expect_success 'am without --committer-date-is-author-date' '
 	test "$at" != "$ct"
 '
 
+test_expect_success 'am --ignore-date' '
+	git checkout first &&
+	test_tick &&
+	git am --ignore-date patch1 &&
+	git cat-file commit HEAD | sed -e "/^$/q" >head1 &&
+	at=$(sed -ne "/^author /s/.*> //p" head1) &&
+	echo "$at" | grep "+0000"
+'
+
 test_done
-- 
1.6.1.224.gb56c7

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23  8:08   ` Christian MICHON
@ 2009-01-23  8:51     ` Christian MICHON
  0 siblings, 0 replies; 19+ messages in thread
From: Christian MICHON @ 2009-01-23  8:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git list

On Fri, Jan 23, 2009 at 9:08 AM, Christian MICHON
<christian.michon@gmail.com> wrote:
>> A patch to butcher "git-am" to copy GIT_COMMITTER_DATE from
>> GIT_AUTHOR_DATE and export it should be trivial to implement, though.
>>
>> Perhaps something like this totally untested patch.
>>
>
> I love this idea. I'll try to test it asap. Thanks!
>

working fine! I've predictable/reproducible commits with this patch!

many thanks and kudos!

-- 
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23  8:26   ` Nanako Shiraishi
@ 2009-01-23  9:39     ` Junio C Hamano
  2009-01-23 22:29       ` Jeff King
  2009-01-23  9:52     ` Nanako Shiraishi
  2009-01-23 12:38     ` [PATCH] git-am: Add --ignore-date option Johannes Schindelin
  2 siblings, 1 reply; 19+ messages in thread
From: Junio C Hamano @ 2009-01-23  9:39 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: git list, Christian MICHON

Nanako Shiraishi <nanako3@lavabit.com> writes:

> Quoting Junio C Hamano <gitster@pobox.com>:
>
>> Correct.  I did not run that new test, let alone existing ones ;-)
>
> I applied your patch and run the test suite, including the new one, and they passed.

Thanks.

> I tried to write a new option I said that I wanted in my previous message.  Here is a patch.
>
> --->8---
> Subject: [PATCH] git-am: Add --ignore-date option

Good.

Leaving "Subject: " in saves me typing, because I do not have to insert it
manually when editing the submitted patch in my MUA to chop off everything
before the scissors.

> This new option makes the command ignore the date header field recorded in
> the format-patch output.  The commits will have the timestamp when they
> are created instead.
>
> You can work a lot in one day to accumulate many changes, but apply and
> push to the public repository only some of them at the end of the first
> day.  Then next day you can spend all your working hours reading comics or
> chatting with your coworkers, and apply your remaining patches from the
> previous day using this option to pretend that you have been working at
> the end of the day.

LOL.  A slacker option is a tough sell to a serious management, though.

I think it would work equally well if you somehow manage to pass this
through "git-rebase", but this won't work with "git-rebase --interactive".

> @@ -379,7 +383,13 @@ do
>  
>  	GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
>  	GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
> -	GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
> +	case "$ignore_date" in
> +	    t)
> +		GIT_AUTHOR_DATE="$(date -R)"
> +		;;
> +	    '')
> +		GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
> +	esac

Please align case arm labels with case/esac; iow, do not indent t) and '')
by four spaces, when you write your next case/esac statement.

"date -R" is a GNU extension; avoid it (I'll show you how at the end).

> diff --git a/t/t4150-am.sh b/t/t4150-am.sh
> index 8d3fb00..5ecf456 100755
> --- a/t/t4150-am.sh
> +++ b/t/t4150-am.sh
> @@ -277,4 +277,13 @@ test_expect_success 'am without --committer-date-is-author-date' '
>  	test "$at" != "$ct"
>  '
>  
> +test_expect_success 'am --ignore-date' '
> +	git checkout first &&
> +	test_tick &&
> +	git am --ignore-date patch1 &&
> +	git cat-file commit HEAD | sed -e "/^$/q" >head1 &&
> +	at=$(sed -ne "/^author /s/.*> //p" head1) &&
> +	echo "$at" | grep "+0000"
> +'

This is a convoluted logic.

The committer and author dates are set to -0700 timezone by test_tick,
while TZ is set to UTC (+0000) by test-lib.sh, and you are taking
advantage of them to see which one is being used.

But I do not think of a better way to do this offhand, so I'll let it
pass.

Regarding the "date -R" thing, I think we can take advantage of the fact
that an empty GIT_AUTHOR_DATE (and GIT_COMMITTER_DATE) means "do not use
this environment variable, but use the current date instead".  Something
like this patch on top of yours, whose first hunk reverts your change to
use "date -R", and sets GIT_AUTHOR_DATE to empty when --ignore-date is
asked for.

No, I didn't test it.

diff --git i/git-am.sh w/git-am.sh
index eb88d90..f935178 100755
--- i/git-am.sh
+++ w/git-am.sh
@@ -383,13 +383,7 @@ do
 
 	GIT_AUTHOR_NAME="$(sed -n '/^Author/ s/Author: //p' "$dotest/info")"
 	GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
-	case "$ignore_date" in
-	    t)
-		GIT_AUTHOR_DATE="$(date -R)"
-		;;
-	    '')
-		GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
-	esac
+	GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
 
 	if test -z "$GIT_AUTHOR_EMAIL"
 	then
@@ -536,6 +530,10 @@ do
 	tree=$(git write-tree) &&
 	parent=$(git rev-parse --verify HEAD) &&
 	commit=$(
+		if test -n "$ignore_date"
+		then
+			GIT_AUTHOR_DATE=
+		fi
 		if test -n "$committer_date_is_author_date"
 		then
 			GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23  8:26   ` Nanako Shiraishi
  2009-01-23  9:39     ` Junio C Hamano
@ 2009-01-23  9:52     ` Nanako Shiraishi
  2009-01-23 17:27       ` Junio C Hamano
  2009-01-23 12:38     ` [PATCH] git-am: Add --ignore-date option Johannes Schindelin
  2 siblings, 1 reply; 19+ messages in thread
From: Nanako Shiraishi @ 2009-01-23  9:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git list, Christian MICHON

Quoting Junio C Hamano <gitster@pobox.com>:

>> --->8---
>> Subject: [PATCH] git-am: Add --ignore-date option
>
> Good.
>
> Leaving "Subject: " in saves me typing, because I do not have to insert it
> manually when editing the submitted patch in my MUA to chop off everything
> before the scissors.

I am sorry to ask you a stupid question, but do you mean you want to have
"Subject: " there, or do you mean you want me to leave that word out?

> I think it would work equally well if you somehow manage to pass this
> through "git-rebase", but this won't work with "git-rebase --interactive".

I can try to change git-rebase if you want, but I do not think I can
modify git-rebase --interactive.  The script looked very scary last time I
looked at it (^_^;;;).

>> +test_expect_success 'am --ignore-date' '
>> +	git checkout first &&
>> +	test_tick &&
>> +	git am --ignore-date patch1 &&
>> +	git cat-file commit HEAD | sed -e "/^$/q" >head1 &&
>> +	at=$(sed -ne "/^author /s/.*> //p" head1) &&
>> +	echo "$at" | grep "+0000"
>> +'
>
> This is a convoluted logic.
>
> The committer and author dates are set to -0700 timezone by test_tick,
> while TZ is set to UTC (+0000) by test-lib.sh, and you are taking
> advantage of them to see which one is being used.
>
> But I do not think of a better way to do this offhand, so I'll let it
> pass.
>
> Regarding the "date -R" thing, I think we can take advantage of the fact
> that an empty GIT_AUTHOR_DATE (and GIT_COMMITTER_DATE) means "do not use
> this environment variable, but use the current date instead".  Something
> like this patch on top of yours, whose first hunk reverts your change to
> use "date -R", and sets GIT_AUTHOR_DATE to empty when --ignore-date is
> asked for.
>
> No, I didn't test it.

I did, and it works.

Thank you very much.

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] git-am: Add --ignore-date option
  2009-01-23  8:26   ` Nanako Shiraishi
  2009-01-23  9:39     ` Junio C Hamano
  2009-01-23  9:52     ` Nanako Shiraishi
@ 2009-01-23 12:38     ` Johannes Schindelin
  2009-01-23 13:17       ` Adeodato Simó
  2 siblings, 1 reply; 19+ messages in thread
From: Johannes Schindelin @ 2009-01-23 12:38 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: Junio C Hamano, git list, Christian MICHON

Hi,

[if you would have given a new mail subject to your mail, gitweb would 
 stand a chance to find it]

On Fri, 23 Jan 2009, Nanako Shiraishi wrote:

> Subject: [PATCH] git-am: Add --ignore-date option
> 
> This new option makes the command ignore the date header field recorded in
> the format-patch output.  The commits will have the timestamp when they
> are created instead.
> 
> You can work a lot in one day to accumulate many changes, but apply and
> push to the public repository only some of them at the end of the first
> day.  Then next day you can spend all your working hours reading comics or
> chatting with your coworkers, and apply your remaining patches from the
> previous day using this option to pretend that you have been working at
> the end of the day.

FWIW I have that problem in one of my workflows, and I do this:

	grep -v "^Date:" < $MBOX | git am

Of course, this assumes that none of my commit messages has the string 
"Date:" at the beginning of the line...

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] git-am: Add --ignore-date option
  2009-01-23 12:38     ` [PATCH] git-am: Add --ignore-date option Johannes Schindelin
@ 2009-01-23 13:17       ` Adeodato Simó
  0 siblings, 0 replies; 19+ messages in thread
From: Adeodato Simó @ 2009-01-23 13:17 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Nanako Shiraishi, Junio C Hamano, git list, Christian MICHON

* Johannes Schindelin [Fri, 23 Jan 2009 13:38:34 +0100]:

> FWIW I have that problem in one of my workflows, and I do this:
> 	grep -v "^Date:" < $MBOX | git am

> Of course, this assumes that none of my commit messages has the string 
> "Date:" at the beginning of the line...

In case you're interested:

    % formail -I 'Date' -s < $MBOX | git am

is robust against your assumption being wrong. (I realize ^Date: is not
very likely in commit messages, but I thought I'd mention nevertheless.)

Cheers,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
- Are you sure we're good?
- Always.
                -- Rory and Lorelai

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23  9:52     ` Nanako Shiraishi
@ 2009-01-23 17:27       ` Junio C Hamano
  0 siblings, 0 replies; 19+ messages in thread
From: Junio C Hamano @ 2009-01-23 17:27 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: git list, Christian MICHON

Nanako Shiraishi <nanako3@lavabit.com> writes:

> Quoting Junio C Hamano <gitster@pobox.com>:
>
>>> --->8---
>>> Subject: [PATCH] git-am: Add --ignore-date option
>>
>> Good.
>>
>> Leaving "Subject: " in saves me typing, because I do not have to insert it
>> manually when editing the submitted patch in my MUA to chop off everything
>> before the scissors.
>
> I am sorry to ask you a stupid question, but do you mean you want to have
> "Subject: " there, or do you mean you want me to leave that word out?

Sorry for poor use of the language.  I want to see "Subject: " on the
line after the scissors.  That way, I can remove everything up to the
scissors, and the resulting message body will start with a line that
begins with "Subject: ", which overrides the subject of the e-mail.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23  9:39     ` Junio C Hamano
@ 2009-01-23 22:29       ` Jeff King
  2009-01-24  0:34         ` Johannes Schindelin
  0 siblings, 1 reply; 19+ messages in thread
From: Jeff King @ 2009-01-23 22:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nanako Shiraishi, git list, Christian MICHON

On Fri, Jan 23, 2009 at 01:39:27AM -0800, Junio C Hamano wrote:

> > --->8---
> > Subject: [PATCH] git-am: Add --ignore-date option
> 
> Good.
> 
> Leaving "Subject: " in saves me typing, because I do not have to insert it
> manually when editing the submitted patch in my MUA to chop off everything
> before the scissors.

Interesting to know. I have intentionally _not_ been including them,
because I assumed you marked up _after_ git-am (i.e., via "git commit
--amend) in which case you would have to delete it manually. I suppose
it makes more sense to do so before git-am, though, since then it will
respect From: fields and the like (which it would otherwise ignore,
since they are blocked by all of the cover letter cruft that you will
end up deleting).

So good to know, and I will start generating my patches differently.

-Peff

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-23 22:29       ` Jeff King
@ 2009-01-24  0:34         ` Johannes Schindelin
  2009-01-24  0:52           ` Jeff King
  0 siblings, 1 reply; 19+ messages in thread
From: Johannes Schindelin @ 2009-01-24  0:34 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, Nanako Shiraishi, git list, Christian MICHON

Hi,

On Fri, 23 Jan 2009, Jeff King wrote:

> On Fri, Jan 23, 2009 at 01:39:27AM -0800, Junio C Hamano wrote:
> 
> > > --->8---
> > > Subject: [PATCH] git-am: Add --ignore-date option
> > 
> > Good.
> > 
> > Leaving "Subject: " in saves me typing, because I do not have to insert it
> > manually when editing the submitted patch in my MUA to chop off everything
> > before the scissors.
> 
> Interesting to know. I have intentionally _not_ been including them,
> because I assumed you marked up _after_ git-am (i.e., via "git commit
> --amend) in which case you would have to delete it manually. I suppose
> it makes more sense to do so before git-am, though, since then it will
> respect From: fields and the like (which it would otherwise ignore,
> since they are blocked by all of the cover letter cruft that you will
> end up deleting).
> 
> So good to know, and I will start generating my patches differently.

Note that your patches will not be found using Pasky's "mail" link in 
gitweb, if you do not put the commit subject into the _real_ mail subject.

Dunno if I like that.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-24  0:34         ` Johannes Schindelin
@ 2009-01-24  0:52           ` Jeff King
  2009-01-24  1:43             ` Johannes Schindelin
  0 siblings, 1 reply; 19+ messages in thread
From: Jeff King @ 2009-01-24  0:52 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Junio C Hamano, Nanako Shiraishi, git list, Christian MICHON

On Sat, Jan 24, 2009 at 01:34:41AM +0100, Johannes Schindelin wrote:

> > So good to know, and I will start generating my patches differently.
> 
> Note that your patches will not be found using Pasky's "mail" link in 
> gitweb, if you do not put the commit subject into the _real_ mail subject.
> 
> Dunno if I like that.

I think that is not a new problem. Quite a few patches are "how about
this" patches in the middle of a thread, and leave the old subject.
IMHO, that is a failing of the tool in not tracking common practice, not
the other way around.

-Peff

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-24  0:52           ` Jeff King
@ 2009-01-24  1:43             ` Johannes Schindelin
  2009-01-24  2:35               ` Jeff King
  0 siblings, 1 reply; 19+ messages in thread
From: Johannes Schindelin @ 2009-01-24  1:43 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, Nanako Shiraishi, git list, Christian MICHON

Hi,

On Fri, 23 Jan 2009, Jeff King wrote:

> On Sat, Jan 24, 2009 at 01:34:41AM +0100, Johannes Schindelin wrote:
> 
> > > So good to know, and I will start generating my patches differently.
> > 
> > Note that your patches will not be found using Pasky's "mail" link in 
> > gitweb, if you do not put the commit subject into the _real_ mail subject.
> > 
> > Dunno if I like that.
> 
> I think that is not a new problem. Quite a few patches are "how about
> this" patches in the middle of a thread, and leave the old subject.
> IMHO, that is a failing of the tool in not tracking common practice, not
> the other way around.

You know exactly what "fixing the tool" would mean.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: how to force a commit date matching info from a mbox ?
  2009-01-24  1:43             ` Johannes Schindelin
@ 2009-01-24  2:35               ` Jeff King
  0 siblings, 0 replies; 19+ messages in thread
From: Jeff King @ 2009-01-24  2:35 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Junio C Hamano, Nanako Shiraishi, git list, Christian MICHON

On Sat, Jan 24, 2009 at 02:43:47AM +0100, Johannes Schindelin wrote:

> > I think that is not a new problem. Quite a few patches are "how about
> > this" patches in the middle of a thread, and leave the old subject.
> > IMHO, that is a failing of the tool in not tracking common practice, not
> > the other way around.
> 
> You know exactly what "fixing the tool" would mean.

Yes, I know. I think Pasky's tool is a clever hack, but I never expected
it to be comprehensive in its results. At the GitTogether, we discussed
some interesting ideas for tracking the mailing list and showing a more
patch-oriented view, but those would be a lot of work, and I am not
volunteering to do it right now.

What I meant by my comment was that I am not too concerned with tweaking
my workflow to help Pasky's tool.

-Peff

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-01-24  2:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-22 22:41 how to force a commit date matching info from a mbox ? Christian MICHON
2009-01-23  0:14 ` Junio C Hamano
2009-01-23  8:08   ` Christian MICHON
2009-01-23  8:51     ` Christian MICHON
2009-01-23  0:21 ` Johannes Schindelin
2009-01-23  8:07   ` Christian MICHON
2009-01-23  0:45 ` Nanako Shiraishi
2009-01-23  7:37   ` Junio C Hamano
2009-01-23  8:26   ` Nanako Shiraishi
2009-01-23  9:39     ` Junio C Hamano
2009-01-23 22:29       ` Jeff King
2009-01-24  0:34         ` Johannes Schindelin
2009-01-24  0:52           ` Jeff King
2009-01-24  1:43             ` Johannes Schindelin
2009-01-24  2:35               ` Jeff King
2009-01-23  9:52     ` Nanako Shiraishi
2009-01-23 17:27       ` Junio C Hamano
2009-01-23 12:38     ` [PATCH] git-am: Add --ignore-date option Johannes Schindelin
2009-01-23 13:17       ` Adeodato Simó

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).