Commit graph

13396 commits

Author SHA1 Message Date
Daniel Barkalow 3ee79d9f59 Combine To: and Cc: headers
RFC 2822 only permits a single To: header and a single Cc: header, so
we need to turn multiple values of each of these into a list. This
will be particularly significant with a command-line option to add Cc:
headers, where the user can't make sure to configure valid header sets
in any easy way.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-19 21:49:38 -08:00
Daniel Barkalow 7d22708b25 Fix format.headers not ending with a newline
Now each value of format.headers will always be treated as a single
valid header, and newlines will be inserted between them as needed.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-19 21:49:38 -08:00
Daniel Barkalow a8d8173e6c Add tests for extra headers in format-patch
Presently, it works with each header ending with a newline, but not
without the newlines.

Also add a test to see that multiple "To:" headers get combined.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-19 21:49:38 -08:00
Daniel Barkalow a5a27c79b7 Add a --cover-letter option to format-patch
If --cover-letter is provided, generate a cover letter message before
the patches, numbered 0.

Original patch thanks to Johannes Schindelin

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-19 21:49:31 -08:00
Daniel Barkalow b02bd65f67 Export some email and pretty-printing functions
These will be used for generating the cover letter in addition to the
patch emails.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-19 00:56:46 -08:00
Daniel Barkalow e1a3734621 Improve message-id generation flow control for format-patch
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-19 00:56:46 -08:00
Daniel Barkalow 7d812145ba Add more tests for format-patch
Tests -o, and an excessively long subject, and --thread, with and
without --in-reply-to=

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-19 00:56:46 -08:00
Junio C Hamano cf5c51efc9 Sync with 1.5.4.2 and start 1.5.5 Release Notes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-17 01:51:46 -08:00
Junio C Hamano 7cb97da17d Merge branch 'maint'
* maint:
  GIT 1.5.4.2
2008-02-17 01:16:44 -08:00
Junio C Hamano e5fc9a0aea GIT 1.5.4.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-17 00:20:38 -08:00
Junio C Hamano f8732c5596 Merge branch 'bd/qsort'
* bd/qsort:
  compat: Add simplified merge sort implementation from glibc
2008-02-16 18:11:47 -08:00
Junio C Hamano 2ac4b4b222 Merge branch 'sp/safecrlf'
* sp/safecrlf:
  safecrlf: Add mechanism to warn about irreversible crlf conversions
2008-02-16 17:59:20 -08:00
Junio C Hamano 990732609c Merge branch 'cc/browser'
* cc/browser:
  Documentation: add 'git-web--browse.txt' and simplify other docs.
  git-web--browse: fix misplaced quote in init_browser_path()
  web--browse: Add a few quotes in 'init_browser_path'.
  Documentation: instaweb: add 'git-web--browse' information.
  Adjust .gitignore for 5884f1(Rename 'git-help--browse.sh'...)
  git-web--browse: do not start the browser with nohup
  instaweb: use 'git-web--browse' to launch browser.
  Rename 'git-help--browse.sh' to 'git-web--browse.sh'.
  help--browse: add '--config' option to check a config option for a browser.
  help: make 'git-help--browse' usable outside 'git-help'.

Conflicts:

	git-web--browse.sh
2008-02-16 17:57:47 -08:00
Junio C Hamano 987e315a6b Merge branch 'jc/gitignore-ends-with-slash'
* jc/gitignore-ends-with-slash:
  gitignore: lazily find dtype
  gitignore(5): Allow "foo/" in ignore list to match directory "foo"
2008-02-16 17:57:06 -08:00
Junio C Hamano 1ae419cb39 Merge branch 'pb/prepare-commit-msg'
* pb/prepare-commit-msg:
  git-commit: add a prepare-commit-msg hook
  git-commit: Refactor creation of log message.
  git-commit: set GIT_EDITOR=: if editor will not be launched
  git-commit: support variable number of hook arguments
2008-02-16 17:56:59 -08:00
Junio C Hamano fef1c4c0a0 Merge branch 'jk/noetcconfig'
* jk/noetcconfig:
  fix config reading in tests
  allow suppressing of global and system config

Conflicts:

	cache.h
2008-02-16 17:56:51 -08:00
Junio C Hamano 093d50e0d2 Merge branch 'jc/submittingpatches'
* jc/submittingpatches:
  Documentation/SubmittingPatches - a suggested patch flow
  Documentation/SubmittingPatches: What's Acked-by and Tested-by?
  Documentation/SubmittingPatches: discuss first then submit
  Documentation/SubmittingPatches: Instruct how to use [PATCH] Subject header
2008-02-16 17:43:25 -08:00
Junio C Hamano 67cdec1e58 Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui:
  git-gui: Correct size of dictionary name widget in options dialog
  git-gui: Paper bag fix bad string length call in spellchecker
2008-02-16 17:42:49 -08:00
Junio C Hamano f124e986cf Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  [PATCH] gitk: Heed the lines of context in merge commits
2008-02-16 17:41:38 -08:00
Junio C Hamano 413b90f0da Merge branch 'maint'
* maint:
  Documentation/git-reset: Add an example of resetting selected paths
  Documentation/git-reset: don't mention --mixed for selected-paths reset
  Documentation/git-reset:
2008-02-16 17:41:23 -08:00
Junio C Hamano a941fb4a43 Documentation/SubmittingPatches - a suggested patch flow
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 17:33:31 -08:00
Pieter de Bie 965053b09a Documentation/git-reset: Add an example of resetting selected paths
Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 10:57:05 -08:00
Pieter de Bie ceb4cacb42 Documentation/git-reset: don't mention --mixed for selected-paths reset
The option is accepted, but that is the only form selected-paths
variant of the reset command takes, so there is no point mentioning it.
And while we're at it, use the dashless git call.

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 10:56:24 -08:00
Junio C Hamano 3983caa531 Documentation/git-reset:
Since 3368d11 (Remove unnecessary git-rm --cached reference from
status output), the status output marks the "Added but not yet
committed" section as "Changes to be committed".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 10:51:46 -08:00
Shawn O. Pearce e7e5170f80 Update fast-import documentation to discuss crash reports
Recent versions of fast-import will now dump information out upon
crashing, making it possible for the frontend developer to review
some state information and possibly restart the import from the
point where it crashed.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 00:47:08 -08:00
Shawn O. Pearce 118805b920 Finish current packfile during fast-import crash handler
If fast-import is in the middle of crashing due to a protocol error
or something like that then it can be very useful to have the mark
table and all objects up until that point be available for a new
import to resume from.

Currently we just close the active packfile, unkeep all of our
newly created packfiles (so they can be deleted), and dump the
marks table to a temporary file.

We don't attempt to update the refs/tags that the process has in
memory as much of that data can be found in the crash report and I'm
not sure it would be the right thing to do under every type of crash.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 00:47:07 -08:00
Shawn O. Pearce 3b08e5b8c9 Include the fast-import marks table in crash reports
If fast-import was not run with --export-marks but we are crashing
the frontend application developer may still benefit from having
that information available to them.  We now include the marks table
as part of the crash report if --export-marks was not supplied on
the command line.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 00:47:07 -08:00
Shawn O. Pearce fbc63ea694 Include annotated tags in fast-import crash reports
If annotated tags were created they exist in a different namespace
within the fast-import process' internal memory tables so we did
not export them in the inactive branch table.  Now they are written
out after the branches, in the order that they were defined by the
frontend process.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 00:47:07 -08:00
Christian Couder cb45f83cbd Documentation: add 'git-web--browse.txt' and simplify other docs.
'git-help.txt' and 'git-instaweb.txt' contained duplicated
information about 'git-web--browse'.

This patch puts this information where it belongs.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 00:46:33 -08:00
Jay Soffian 969702a957 git-help--browse: improve browser support under OS X
/usr/bin/open <document> is used under OS X to open a document as if the
user had double-clicked on the file's icon (i.e. HTML files are opened
w/the user's default browser).

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 00:45:57 -08:00
Junio C Hamano d5558581d2 Merge branch 'maint'
* maint:
  commit: discard index after setting up partial commit
  filter-branch: handle filenames that need quoting
  diff: Fix miscounting of --check output
  hg-to-git: fix parent analysis
  mailinfo: feed only one line to handle_filter() for QP input
  diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"
  Add "const" qualifier to "char *excludes_file".
  Add "const" qualifier to "char *editor_program".
  Add "const" qualifier to "char *pager_program".
  config: add 'git_config_string' to refactor string config variables.
  diff.c: remove useless check for value != NULL
  fast-import: check return value from unpack_entry()
  Validate nicknames of remote branches to prohibit confusing ones
  diff.c: replace a 'strdup' with 'xstrdup'.
  diff.c: fixup garding of config parser from value=NULL
2008-02-16 00:20:37 -08:00
Jeff King 959ba670ad commit: discard index after setting up partial commit
There may still be some entries from the original index that
should be discarded before we show the status. In
particular, if a file was added in the index but not
included in the partial commit, it would still show up in
the status listing as staged for commit.

Ultimately the correct fix is to keep the two states in
separate index_state variables. Then we can avoid having
to reload the cache from the temporary file altogether, and
just point wt_status_print at the correct index.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 00:12:56 -08:00
Junio C Hamano 1fe32cb9d0 filter-branch: handle filenames that need quoting
The command used a very old fashioned construct to extract
filenames out of diff-index and ended up corrupting the output.
We can simply use --name-only and pipe into --stdin mode of
update-index.  It's been like that for the past 2 years or so
since a94d994 (update-index: work with c-quoted name).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 23:57:26 -08:00
Junio C Hamano 0ef617f4b6 diff: Fix miscounting of --check output
c1795bb (Unify whitespace checking) incorrectly made the
checking function return without incrementing the line numbers
when there is no whitespace problem is found on a '+' line.

This resurrects the earlier behaviour.

Noticed and reported by Jay Soffian.  The test script was stolen
from Jay's independent fix.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 23:06:57 -08:00
Stelian Pop 13bf1a9976 hg-to-git: fix parent analysis
Fix a bug in the hg-to-git convertor introduced by commit
1bc7c13af9: when searching the changeset
parents, 'hg log' returns an extra space at the end of the line, which
confuses the .split(' ') based tokenizer:

    Traceback (most recent call last):
      File "hg-to-git.py", line 123, in <module>
          hgchildren[mparent] += ( str(cset), )
      KeyError: ''

Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 23:01:49 -08:00
Jay Soffian 87f1b8849b mailinfo: feed only one line to handle_filter() for QP input
The function is intended to be fed one logical line at a time to
inspect, but a QP encoded raw input line can have more than one
lines, just like BASE64 encoded one.

Quoting LF as =0A may be unusual but RFC2045 allows it.

The issue was noticed and fixed by Jay Soffian.  JC added a test
to protect the fix from regressing later.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 22:16:34 -08:00
Christian Couder b20a60d0c0 diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"
Also use "git_config_string" to simplify code where "cmd" is set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 21:24:54 -08:00
Christian Couder dfb068be8d Add "const" qualifier to "char *excludes_file".
Also use "git_config_string" to simplify "config.c" code
where "excludes_file" is set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 21:24:54 -08:00
Christian Couder ee9601e6be Add "const" qualifier to "char *editor_program".
Also use "git_config_string" to simplify "config.c" code
where "editor_program" is set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 21:24:53 -08:00
Christian Couder 872da32d80 Add "const" qualifier to "char *pager_program".
Also use "git_config_string" to simplify "config.c" code
where "pager_program" is set.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 21:24:53 -08:00
Christian Couder ea5105a5e3 config: add 'git_config_string' to refactor string config variables.
In many places we just check if a value from the config file is not
NULL, then we duplicate it and return 0. This patch introduces the new
'git_config_string' function to do that.

This function is also used to refactor some code in 'config.c'.
Refactoring other files is left for other patches.

Also not all the code in "config.c" is refactored, because the function
takes a "const char **" as its first parameter, but in many places a
"char *" is used instead of a "const char *". (And C does not allow
using a "char **" instead of a "const char **" without a warning.)

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 21:24:53 -08:00
Christian Couder 2c778210f8 diff.c: remove useless check for value != NULL
It is not necessary to check if value != NULL before calling
'parse_lldiff_command' as there is already a check inside this
function.

By the way this patch also improves the existing check inside
'parse_lldiff_command' by using:
	return config_error_nonbool(var);
instead of:
	return error("%s: lacks value", var);

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 21:24:53 -08:00
Shawn O. Pearce e8b32e0610 fast-import: check return value from unpack_entry()
If the tree object we have asked for is deltafied in the packfile and
the delta did not apply correctly or was not able to be decompressed
from the packfile then we can get back NULL instead of the tree data.
This is (part of) the reason why read_sha1_file() can return NULL, so
we need to also handle it the same way.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 20:11:51 -08:00
Daniel Barkalow df93e33c8b Validate nicknames of remote branches to prohibit confusing ones
The original problem was that the parsers for configuration files were
getting confused by seeing as nicknames remotes that involved
directory-changing characters. In particular, the branches config file
for ".." was particularly mystifying on platforms that can open
directories and read odd data from them.

The validation function was written by Junio Hamano (with a typo
corrected).

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 14:23:22 -08:00
Christian Couder 8ca496e97d diff.c: replace a 'strdup' with 'xstrdup'.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 14:11:28 -08:00
Junio C Hamano 588071112c diff.c: fixup garding of config parser from value=NULL
Christian Couder noticed that there still were a handcrafted error()
call that we should have converted to config_error_nonbool() where
parse_lldiff_command() parses the configuration file.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 09:37:54 -08:00
Shawn O. Pearce 740b9b9ff4 git-gui: Correct size of dictionary name widget in options dialog
We don't need to fill this entire horizontal cavity, it looks really
bad on some platforms to stretch the widget out to fill the window.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-14 01:07:39 -05:00
Shawn O. Pearce 765239e9d2 git-gui: Paper bag fix bad string length call in spellchecker
We don't want the list length, we need the string length.

Found due to a bad " character discovered in the text and
Tcl throwing 'unmatched open quote in list'.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-14 01:05:04 -05:00
Johannes Sixt 6675ea4240 [PATCH] gitk: Heed the lines of context in merge commits
There is an edit box where the number of context lines can be chosen.
But it was only used when regular diffs were displayed, not for
merge commits.   This fixes it.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-02-14 10:49:44 +11:00
Junio C Hamano aa8d53ec38 Merge branch 'maint'
* maint:
  config: add test cases for empty value and no value config variables.
  cvsimport: have default merge regex also match beginning of commit message
  git clone -s documentation: force a new paragraph for the NOTE
  status: suggest "git rm --cached" to unstage for initial commit
  Protect get_author_ident_from_commit() from filenames in work tree
  upload-pack: Initialize the exec-path.
  bisect: use verbatim commit subject in the bisect log
  git-cvsimport.txt: fix '-M' description.
  Revert "pack-objects: only throw away data during memory pressure"
2008-02-13 14:33:19 -08:00