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

Re: [PATCH] Add date format --local-zone

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 25, 2007, 12:40 UTC
Message-ID
<Pine.LNX.4.64.0704251438000.6954@racer.site>
In-Reply-To
<1177482982542-git-send-email-junkio@cox.net>
Hi,
On Tue, 24 Apr 2007, Junio C Hamano wrote:
Show 15 quoted lines
> --- a/revision.c
> +++ b/revision.c
> @@ -1111,7 +1111,11 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
>  				continue;
>  			}
>  			if (!strcmp(arg, "--relative-date")) {
> -				revs->relative_date = 1;
> +				revs->date_mode = DATE_RELATIVE;
> +				continue;
> +			}
> +			if (!strcmp(arg, "--local-zone")) {
> +				revs->date_mode = DATE_LOCAL;
>  				continue;
>  			}
>  

I think that it will become more convenient at some stage to add "--date=local", and have a common option parser in date.c.

Show 10 quoted lines
> diff --git a/revision.h b/revision.h
> index 5b41e2d..8f8720a 100644
> --- a/revision.h
> +++ b/revision.h
> @@ -64,7 +64,7 @@ struct rev_info {
>  	/* Format info */
>  	unsigned int	shown_one:1,
>  			abbrev_commit:1,
> -			relative_date:1;
> +			date_mode:2;

Why not go the full nine yards, and make this a full int? It's not like rev_info is allocated a million times...

Ciao, Dscho

Previous: Shawn O. PearceNext: Linus Torvalds
Message 3 of 12 in “Add date format --local-zone”
  1. Add date format --local-zoneJunio C Hamano, Apr 25, 2007
  2. Shawn O. PearceApr 25, 2007
  3. Johannes SchindelinApr 25, 2007
  4. Linus TorvaldsApr 25, 2007
  5. Linus TorvaldsApr 25, 2007
  6. Junio C HamanoApr 25, 2007
  7. Alex RiesenApr 25, 2007
  8. Junio C HamanoApr 25, 2007
  9. Alex RiesenApr 25, 2007
  10. Junio C HamanoApr 25, 2007
  11. 1/2 Add --date={local,relative,default}Junio C Hamano, Apr 26, 2007
  12. David KågedalApr 26, 2007

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.