Commit Graph

4820 Commits

Author SHA1 Message Date
Junio C Hamano
17cf39294a Merge branch 'master' into next
* master:
  cvsimport: do not barf on creation of an empty file.
2006-05-23 16:31:05 -07:00
Junio C Hamano
61efa5e300 cvsimport: do not barf on creation of an empty file.
When the server says "created this file whose length is empty",
we mistakenly said "oops, the server did not say a sensible
thing".  Fix it.

Spotted and fixed by Linus, acked by Martin.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 16:30:39 -07:00
Junio C Hamano
dcaad49c92 Merge branch 'sp/reflog' into next
* sp/reflog:
  Enable ref log creation in git checkout -b.
  Create/delete branch ref logs.
  Include ref log detail in commit, reset, etc.
  Change order of -m option to update-ref.
  Correct force_write bug in refs.c
  Change 'master@noon' syntax to 'master@{noon}'.
  Log ref updates made by fetch.
  Force writing ref if it doesn't exist.
  Added logs/ directory to repository layout.
  General ref log reading improvements.
  Fix ref log parsing so it works properly.
  Support 'master@2 hours ago' syntax
  Log ref updates to logs/refs/<ref>
  Convert update-ref to use ref_lock API.
  Improve abstraction of ref lock/write.
2006-05-23 15:07:47 -07:00
Junio C Hamano
33b292610d Merge branch 'eb/mailinfo' into next
* eb/mailinfo:
  Allow in body headers beyond the in body header prefix.
  More accurately detect header lines in read_one_header_line
  In handle_body only read a line if we don't already have one.
  Refactor commit messge handling.
  Move B and Q decoding into check header.
  Make read_one_header_line return a flag not a length.
2006-05-23 14:57:00 -07:00
Junio C Hamano
ae51cb04bc Merge branch 'be/tag' into next
* be/tag:
  add more informative error messages to git-mktag
  remove the artificial restriction tagsize < 8kb
2006-05-23 14:53:17 -07:00
Junio C Hamano
e96b6c4bf6 Merge branch 'jc/builtin-n-tar-tree' into next
* jc/builtin-n-tar-tree:
  Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree.
  Builtin git-show-branch.
  Builtin git-apply.
  Builtin git-commit-tree.
  Builtin git-read-tree.
  Builtin git-tar-tree.
  Builtin git-ls-tree.
  Builtin git-ls-files.
2006-05-23 14:52:45 -07:00
Junio C Hamano
1af0d11283 Merge branch 'jc/tartree' into jc/builtin-n-tar-tree
* jc/tartree:
  built-in tar-tree and remote tar-tree
2006-05-23 14:44:31 -07:00
Eric W. Biederman
2dec02b1ec Allow in body headers beyond the in body header prefix.
- handle_from is fixed to not mangle it's input line.

- Then handle_inbody_header is allowed to look in
  the body of a commit message for additional headers
  that we haven't already seen.

This allows patches with all of the right information in
unfortunate places to be imported.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 14:11:03 -07:00
Eric W. Biederman
f30b20282b More accurately detect header lines in read_one_header_line
Only count lines of the form '^.*: ' and '^From ' as email
header lines.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 14:08:32 -07:00
Eric W. Biederman
1f36bee67e In handle_body only read a line if we don't already have one.
This prepares for detecting non-email patches that don't have
mail headers.  In which case we have already read the first
line so handle_body should not ignore it.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 14:07:42 -07:00
Eric W. Biederman
8b4525fb3c Refactor commit messge handling.
- Move handle_info into main so it is called once
  after everything has been parsed.  This allows the removal
  of a static variable and removes two duplicate calls.

- Move parsing of inbody headers into handle_commit.
  This means we parse the in-body headers after we have decoded
  the character set, and it removes code duplication between
  handle_multipart_one_part and handle_body.

- Change the flag indicating that we have seen an in body
  prefix header into another bit in seen.
  This is a little more general and allows the possibility of parsing
  in body headers after the body message has begun.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 14:04:47 -07:00
Eric W. Biederman
3350453014 Move B and Q decoding into check header.
B and Q decoding is not appropriate for in body headers, so move
it up to where we explicitly know we have a real email header.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 14:01:59 -07:00
Eric W. Biederman
f8128cfb8d Make read_one_header_line return a flag not a length.
Currently we only use the return value from read_one_header line
to tell if the line we have read is a header or not.  So make
it a flag.  This paves the way for better email detection.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 14:00:15 -07:00
Björn Engelmann
cfba045930 add more informative error messages to git-mktag
Signed-off-by: Björn Engelmann <BjEngelmann@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:38:29 -07:00
Björn Engelmann
e7332f96b3 remove the artificial restriction tagsize < 8kb
Signed-off-by: Björn Engelmann <BjEngelmann@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:38:29 -07:00
Peter Eriksen
e8cc9cd98e Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:13 -07:00
Peter Eriksen
51ce34b992 Builtin git-show-branch.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:13 -07:00
Peter Eriksen
ac6245e31a Builtin git-apply.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:13 -07:00
Peter Eriksen
6d96ac18e5 Builtin git-commit-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Peter Eriksen
d147e501f3 Builtin git-read-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Peter Eriksen
56d1398ad3 Builtin git-tar-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Peter Eriksen
aae01bda7f Builtin git-ls-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Peter Eriksen
0864f26421 Builtin git-ls-files.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Junio C Hamano
95f5bddcd2 Merge branch 'jc/dirwalk-n-cache-tree' into next
* jc/dirwalk-n-cache-tree:
  builtin-rm: squelch compiler warnings.
2006-05-23 01:31:52 -07:00
Junio C Hamano
3fb3cc69af builtin-rm: squelch compiler warnings.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 01:31:38 -07:00
Junio C Hamano
646881a156 Merge branch 'master' into next
* master:
  Add git-quiltimport to .gitignore.
  cvsimport: introduce _fetchfile() method and used a 1M buffer to read()
  cvsimport: cleanup commit function
  cvsimport: use git-update-index --index-info
  git status: skip empty directories, and add -u to show all untracked files
  cvsimport: repack every kilo-commits.
  cvsimport: introduce -L<imit> option to workaround memory leaks
2006-05-23 01:26:34 -07:00
Peter Eriksen
405053d2d9 Add git-quiltimport to .gitignore.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 01:26:21 -07:00
Martin Langhoff
55cad84299 cvsimport: introduce _fetchfile() method and used a 1M buffer to read()
File retrieval from the socket is now moved to _fetchfile() and we now
cap reads at 1MB. This should limit the memory growth of the cvsimport
process.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 01:16:08 -07:00
Jeff King
e73aefe4fd cvsimport: cleanup commit function
This change attempts to clean up the commit function to make it a bit
easier to read (or at least the first half of it). It also improves
robustness and performance. Specifically:
  - report get_headref errors on opening ref unless the error is ENOENT
  - use regex to check for sha1 instead of length
  - use lexically scoped filehandles which get cleaned up automagically
  - check for error on both 'print' and 'close' (since output is buffered)
  - avoid "fork, do some perl, then exec" in commit(). It's not necessary,
    and we probably end up COW'ing parts of the perl process. Plus the code
    is much smaller because we can use open2()
  - avoid calling strftime over and over (mainly a readability cleanup)

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 00:50:50 -07:00
Jeff King
6a1871e174 cvsimport: use git-update-index --index-info
This should reduce the number of git-update-index forks required per
commit. We now do adds/removes in one call, and we are no longer forced to
deal with argv limitations.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 00:41:39 -07:00
Matthias Lederhofer
443f8338b9 git status: skip empty directories, and add -u to show all untracked files
By default, we use --others --directory to show uninteresting
directories (to get user's attention) without their contents (to
unclutter output).  Showing empty directories do not make sense,
so pass --no-empty-directory when we do so.

Giving -u (or --untracked) disables this uncluttering to let the
user get all untracked files.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 00:36:51 -07:00
Linus Torvalds
4adcea995e cvsimport: repack every kilo-commits.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Acked-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 00:31:36 -07:00
Martin Langhoff
06918348de cvsimport: introduce -L<imit> option to workaround memory leaks
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 00:29:35 -07:00
Junio C Hamano
4d8df3feb8 Merge branch 'se/http' into next
* se/http:
  Remove possible segfault in http-fetch.
  Install git builtins into gitexecdir rather than bindir.
  Change GIT-VERSION-GEN to call git commands with "git" not "git-".
  cvsimport: replace anonymous sub ref with a normal sub
  cvsimport: minor fixups
  Problem: 'trap...exit' causes error message when /bin/sh is ash.
  Avoid segfault in diff --stat rename output.
  Tutorial #2: broken link fix.
  git help: remove whatchanged from list of common commands
2006-05-22 18:54:19 -07:00
Junio C Hamano
22f7c8cc91 Merge branch 'jc/fmt-patch' into next
* jc/fmt-patch:
  builtin format-patch: squelch content-type for 7-bit ASCII
  CMIT_FMT_EMAIL: Q-encode Subject: and display-name part of From: fields.
2006-05-22 18:54:10 -07:00
Sean
07001f95a6 Remove possible segfault in http-fetch.
Free the curl string lists after running http_cleanup to
avoid an occasional segfault in the curl library.  Seems
to only occur if the website returns a 405 error.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 18:52:58 -07:00
Sean
7f7e6eacf9 Install git builtins into gitexecdir rather than bindir.
Moving "git-cmd" commands out of the path and into a special
git exec path, should include the builtins.

[jc: fixed the case where bindir == gitexecdir - ln -f fails
 with a complaint that src and dst are the same, likewise for
 the fallback cp.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 18:52:19 -07:00
Sean
1100ac81a9 Change GIT-VERSION-GEN to call git commands with "git" not "git-".
GIT-VERSION-GEN can incorrectly return a default version of
"v1.3.GIT" because it tries to execute git commands using the
"git-cmd" format that expects all git commands to be in the $PATH.
Convert these to  "git cmd" format so that a proper answer is
returned even when the git commands have been moved out of the
$PATH and into a $gitexecdir.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 18:20:46 -07:00
Martin Langhoff
c4b16f8d77 cvsimport: replace anonymous sub ref with a normal sub
commit() does not need to be an anonymous subreference. Keep it simple.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 18:16:44 -07:00
Martin Langhoff
f396f01f11 cvsimport: minor fixups
Cleanup @skipped after it's used. Close a fhandle.
Removing suspects one at a time.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 18:12:27 -07:00
Yakov Lerner
f803eec51b Problem: 'trap...exit' causes error message when /bin/sh is ash.
Problem: 'trap...exit' causes error message when /bin/sh is ash.
Fix: Change 'trap...exit' to 'trap...0' like in other scripts.

Signed-off-by: Yakov Lerner <iler.ml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 18:11:52 -07:00
Sean
e3008464e7 Avoid segfault in diff --stat rename output.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 18:00:38 -07:00
Junio C Hamano
884e3134a0 Tutorial #2: broken link fix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 15:34:40 -07:00
Martin Waitz
5126f35a54 git help: remove whatchanged from list of common commands
whatchanged is replaced by git log now.

Signed-off-by: Martin Waitz
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 13:42:58 -07:00
Junio C Hamano
0c1d1ae43b Merge branch 'jc/fetch-sorted' into next
* jc/fetch-sorted:
  fetch-pack: output refs in the order they were given on the command line.
2006-05-22 05:32:53 -07:00
Junio C Hamano
9546010b7b fetch-pack: output refs in the order they were given on the command line.
Currently, fetched refs are output in the order the remote side
happened to send them.  This changes the order to match the
order of refs that were given on the command line.  To the
existing core callers (git-fetch and git-clone) this does not
make any difference, but for other Porcelain use, it would be
more intuitive.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 05:32:38 -07:00
Junio C Hamano
b05b52027c Merge branch 'master' into next
* master:
  diff: minor option combination fix.
2006-05-22 00:33:34 -07:00
Junio C Hamano
5e363541d0 diff: minor option combination fix.
output_format == DIFFSTAT and with_stat == true does not make sense, and
the way the code is structured it causes trouble.  Avoid it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 00:31:02 -07:00
Junio C Hamano
c831da6647 builtin format-patch: squelch content-type for 7-bit ASCII
When --attach is not used, usually we do not say Content-Type:
and fluff, but if the commit message is not 7-bit ASCII, mark
it as "text/plain; charset=UTF-8".  This unclutters output
somewhat.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-21 23:55:00 -07:00
Junio C Hamano
cdd406e389 CMIT_FMT_EMAIL: Q-encode Subject: and display-name part of From: fields.
By convention, the commit message and the author/committer names
in the commit objects are UTF-8 encoded.  When formatting for
e-mails, Q-encode them according to RFC 2047.

While we are at it, generate the content-type and
content-transfer-encoding headers as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-21 21:39:20 -07:00