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

[PATCH] Use user.name and user.email in import-tars.perl

From
Mike Hommey <mh@glandium.org>
Date
Feb 24, 2008, 12:57 UTC
Message-ID
<1203857838-29505-1-git-send-email-mh@glandium.org>
Mimic what is done in git-import.sh and git-import.perl
Signed-off-by: Mike Hommey <mh@glandium.org>
---
 And that made me wonder if it wouldn't be worth, actually, to have
 git config user.name and git config user.email return the "magic" values
 gotten from guessing in ident.c when no value is in the config. That would
 allow scripts, which have no other simple means to get the user name and
 email, to have the same feature as builtins.
 contrib/fast-import/import-tars.perl |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/contrib/fast-import/import-tars.perl b/contrib/fast-import/import-tars.perl
index 23aeb25..39c091c 100755
--- a/contrib/fast-import/import-tars.perl
+++ b/contrib/fast-import/import-tars.perl
@@ -14,8 +14,10 @@ die "usage: import-tars *.tar.{gz,bz2,Z}\n" unless @ARGV;
 
 my $branch_name = 'import-tars';
 my $branch_ref = "refs/heads/$branch_name";
-my $committer_name = 'T Ar Creator';
-my $committer_email = 'tar@example.com';
+chomp(my $committer_name = `git config user.name`);
+chomp(my $committer_email = `git config user.email`);
+die 'You need to set user name and email'
+  unless $committer_name && $committer_email;
 
 open(FI, '|-', 'git', 'fast-import', '--quiet')
 	or die "Unable to start git fast-import: $!\n";
-- 
1.5.4.1.48.g0d77
Next: Junio C Hamano
Message 1 of 6 in “Use user.name and user.email in import-tars.perl”
  1. Use user.name and user.email in import-tars.perlMike Hommey, Feb 24, 2008
  2. Junio C HamanoFeb 24, 2008
  3. Use GIT_COMMITTER_IDENT instead of hardcoded values in import-tars.perlMike Hommey, Sep 7, 2008
  4. Junio C HamanoSep 7, 2008
  5. Johannes SchindelinSep 8, 2008
  6. Junio C HamanoSep 8, 2008

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.