git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: how to force a commit date matching info from a mbox ?

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Jan 23, 2009, 09:52 UTC
Message-ID
<20090123185209.6117@nanako3.lavabit.com>
In-Reply-To
<20090123172646.6117@nanako3.lavabit.com>
Quoting Junio C Hamano <gitster@pobox.com>:
Show 8 quoted lines
>> --->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 (^_^;;;).

Show 26 quoted lines
>> +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/
Previous: Jeff KingNext: Junio C Hamano
Message 12 of 19 in “how to force a commit date matching info from a mbox ?”
  1. Christian MICHONJan 22, 2009
  2. Junio C HamanoJan 23, 2009
  3. Nanako ShiraishiJan 23, 2009
  4. Junio C HamanoJan 23, 2009
  5. Nanako ShiraishiJan 23, 2009
  6. Junio C HamanoJan 23, 2009
  7. Jeff KingJan 23, 2009
  8. Johannes SchindelinJan 24, 2009
  9. Jeff KingJan 24, 2009
  10. Johannes SchindelinJan 24, 2009
  11. Jeff KingJan 24, 2009
  12. Nanako ShiraishiJan 23, 2009
  13. Junio C HamanoJan 23, 2009
  14. Johannes SchindelinJan 23, 2009
  15. Adeodato SimóJan 23, 2009
  16. Christian MICHONJan 23, 2009
  17. Christian MICHONJan 23, 2009
  18. Johannes SchindelinJan 23, 2009
  19. Christian MICHONJan 23, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.