Jonathan Nieder [Fri, 10 Dec 2010 10:00:55 +0000 (04:00 -0600)]
vcs-svn: eliminate repo_tree structure
Rely on fast-import for information about previous revs.
This requires always setting up backward flow of information, even for
v2 dumps. On the plus side, it simplifies the code by quite a bit and
opens the door to further simplifications.
[db: adjusted to support final version of the cat-blob patch]
[jn: avoiding hard-coding git's name for the empty tree for
portability to other backends]
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Wed, 5 Jan 2011 03:53:33 +0000 (21:53 -0600)]
vcs-svn: add a comment before each commit
Current svn-fe produces output like this:
blob
mark :
7382321
data 5
hello
blob
mark :
7382322
data 5
Hello
commit
mark :3
[...]
M 100644 :
7382321 hello.c
M 100644 :
7382322 hello2.c
This means svn-fe has to keep track of the paths modified in each
commit and the corresponding marks, instead of dealing with each file
as it arrives in input and then forgetting about it. A better
strategy would be to use inline blobs:
commit
mark :3
[...]
M 100644 inline hello.c
data 5
hello
[...]
As a first step towards that, teach svn-fe to notice when the
collection of blobs for each commit starts and write a comment
("# commit 3.") there.
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Fri, 10 Dec 2010 00:57:13 +0000 (18:57 -0600)]
vcs-svn: save marks for imported commits
This way, a person can use
svnadmin dump $path |
svn-fe |
git fast-import --relative-marks --export-marks=svn-revs
to get a list of what commit corresponds to each svn revision (plus
some irrelevant blob names) in .git/info/fast-import/svn-revs.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Fri, 10 Dec 2010 10:21:35 +0000 (04:21 -0600)]
vcs-svn: use higher mark numbers for blobs
Prepare to use mark :5 for the commit corresponding to r5 (and so on).
1 billion seems sufficiently high for blob marks to avoid conflicting
with rev marks, while still leaving room for 3 billion blobs. Such
high mark numbers cause trouble with ancient fast-import versions, but
this topic cannot support git fast-import versions before 1.7.4 (which
introduces the cat-blob command) anyway.
Signed-off-by: Jonathan Nieder <redacted>
David Barr [Sat, 5 Mar 2011 02:30:23 +0000 (13:30 +1100)]
vcs-svn: set up channel to read fast-import cat-blob response
Set up some plumbing: teach the svndump lib to pass a file descriptor
number to the fast_export lib, representing where cat-blob/ls
responses can be read from, and add a get_response_line helper
function to the fast_export lib to read a line from that file.
Unfortunately this means that svn-fe needs file descriptor 3 to be
redirected from somewhere (preferrably the cat-blob stream of a
fast-import backend); otherwise it will fail:
$ svndump <path> | svn-fe
fatal: cannot read from file descriptor 3: Bad file descriptor
For the moment, "svn-fe 3</dev/null" works as a workaround but it
will not work for very long. A fast-import backend that can retrieve
old commits is needed in order to be able to fulfill svn
"Node-copyfrom-rev" requests that refer to revs from a previous run.
[jn: with new change description]
Based-on-patch-by: Jonathan Nieder <redacted>
Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 11 Oct 2010 02:51:21 +0000 (21:51 -0500)]
vcs-svn: allow input errors to be detected promptly
The line_buffer library silently flags input errors until
buffer_deinit time; unfortunately, by that point usually errno is
invalid. Expose the error flag so callers can check for and
report errors early for easy debugging.
some_error_prone_operation(...);
if (buffer_ferror(buf))
return error("input error: %s", strerror(errno));
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Fri, 10 Dec 2010 06:53:54 +0000 (00:53 -0600)]
vcs-svn: simplify repo_modify_path and repo_copy
Restrict the repo_tree API to functions that are actually needed.
- decouple reading the mode and content of dirents from other
operations.
- remove repo_modify_path. It is only used to read the mode from
dirents.
- remove the ability to use repo_read_mode on a missing path. The
existing code only errors out in that case, anyway.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Fri, 10 Dec 2010 10:28:06 +0000 (04:28 -0600)]
vcs-svn: handle_node: use repo_read_path
svn-fe processes each commit in two stages: first decide on the
correct content for all paths and export the relevant blobs, then
export a commit with the result.
But we can keep less state and simplify svn-fe a great deal by
exporting the commit in one step: use 'inline' blobs for each path and
remember nothing. This way, the repo_tree structure could be
eliminated, and we would get support for incremental imports 'for
free'.
Reorganize handle_node along these lines. This is just a code
cleanup; the changes in repo_tree and handle_revision will come later.
[db: backported to apply without text delta support]
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Sat, 20 Nov 2010 19:25:28 +0000 (13:25 -0600)]
vcs-svn: introduce repo_read_path to check the content at a path
The repo_tree structure remembers, for each path in each revision, a
mode (regular file, executable, symlink, or directory) and content
(blob mark or directory structure). Maintaining a second copy of all
this information when it's already in the target repository is
wasteful, it does not persist between svn-fe invocations, and most
importantly, there is no convenient way to transfer it from one
machine to another. So it would be nice to get rid of it.
As a first step, let's change the repo_tree API to match fast-import's
read commands more closely. Currently to read the mode for a path,
one uses
repo_modify_path(path, new_mode, new_content);
which changes the mode and content as a side effect. There is no
function to read the content at a path; add one.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Junio C Hamano [Fri, 4 Mar 2011 22:43:45 +0000 (14:43 -0800)]
apply -v: show offset count when patch did not apply exactly
When the line number the patch intended to touch does not match
the line in the version being patched, GNU patch reports that
it applied the hunk at a different line number, with how big an
offset.
Teach "git apply" to do the same under --verbose option.
Signed-off-by: Junio C Hamano <redacted>
Martin von Zweigbergk [Tue, 1 Mar 2011 01:59:26 +0000 (20:59 -0500)]
rebase: define options in OPTIONS_SPEC
Interactive rebase used to have its own command line processing. Since
it used the 'git rev-parse --parseopt' functionality exposed through
git-sh-setup, it had some flexibility, like matching prefixes of long
options, that non-interactive rebase didn't. When interactive rebase's
command line processing was factored out into git-rebase.sh in
cf432ca
(rebase: factor out command line option processing, 2011-02-06), this
flexibility was lost. Give back that flexibility to interactive and
non-interactive by defining its options in OPTIONS_SPEC.
Also improve the usage message to contain the --continue, --skip and
--abort sub commands.
Reported-by: Johannes Sixt <redacted>
Signed-off-by: Martin von Zweigbergk <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 4 Mar 2011 23:02:45 +0000 (15:02 -0800)]
Merge branch 'maint'
* maint:
Documentation: fix a typo in git-apply.txt
init: remove unnecessary check
Junio C Hamano [Fri, 4 Mar 2011 23:02:28 +0000 (15:02 -0800)]
Merge branch 'mh/p4'
* mh/p4:
git-p4 submit: prevent 'Jobs' section from being removed from p4 change log
Junio C Hamano [Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)]
Merge branch 'mg/maint-difftool-vim-readonly'
* mg/maint-difftool-vim-readonly:
mergetool-lib: call vim in readonly mode for diffs
Junio C Hamano [Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)]
Merge branch 'jn/maint-commit-missing-template'
* jn/maint-commit-missing-template:
commit: error out for missing commit message template
Junio C Hamano [Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)]
Merge branch 'jk/diffstat-binary'
* jk/diffstat-binary:
diff: don't retrieve binary blobs for diffstat
diff: handle diffstat of rewritten binary files
Junio C Hamano [Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)]
Merge branch 'lt/rename-no-extra-copy-detection'
* lt/rename-no-extra-copy-detection:
diffcore-rename: improve estimate_similarity() heuristics
diffcore-rename: properly honor the difference between -M and -C
for_each_hash: allow passing a 'void *data' pointer to callback
Junio C Hamano [Fri, 4 Mar 2011 23:02:26 +0000 (15:02 -0800)]
Merge branch 'jn/test-terminal-punt-on-osx-breakage'
* jn/test-terminal-punt-on-osx-breakage:
tests: skip terminal output tests on OS X
Junio C Hamano [Fri, 4 Mar 2011 23:02:26 +0000 (15:02 -0800)]
Merge branch 'jk/fail-null-clone'
* jk/fail-null-clone:
clone: die when trying to clone missing local path
Junio C Hamano [Fri, 4 Mar 2011 23:02:26 +0000 (15:02 -0800)]
Merge branch 'jc/grep--no-index-pathspec-fix'
* jc/grep--no-index-pathspec-fix:
grep --no-index: honor pathspecs correctly
Junio C Hamano [Fri, 4 Mar 2011 20:25:34 +0000 (12:25 -0800)]
apply: do not patch lines that were already patched
When looking for a place to apply a hunk, we used to check lines that
match the preimage of it, starting from the line that the patch wants to
apply the hunk at, looking forward and backward with increasing offsets
until we find a match.
Colin Guthrie found an interesting case where this misapplied a patch that
wanted to touch a preimage that consists of
}
}
return 0;
}
which is a rather unfortunately common pattern.
The target version of the file originally had only one such location, but
the hunk immediately before that created another instance of such block of
lines, and find_pos() happily reported that the preimage of the hunk
matched what it wanted to modify.
Oops.
By marking the lines application of earlier hunks touched and preventing
match_fragment() from considering them as a match with preimage of other
hunks, we can reduce such an accident.
I also considered to teach apply_one_fragment() to take the offset we have
found while applying the previous hunk into account when looking for a
match with find_pos(), but dismissed that approach, because it would
sometimes work better but sometimes worse, depending on the difference
between the version the patch was created against and the version the
patch is being applied.
This does _not_ prevent misapplication of patches to a file that has many
similar looking blocks of lines and a preimage cannot identify which one
of them should be applied. For that, we would need to scan beyond the
first match in find_pos(), and issue a warning (or error out). That will
be a separate topic.
Signed-off-by: Junio C Hamano <redacted>
Michał Kiedrowicz [Thu, 3 Mar 2011 09:28:30 +0000 (10:28 +0100)]
Documentation: fix a typo in git-apply.txt
git-apply accepts the --cached option, not --cache.
Signed-off-by: Michał Kiedrowicz <redacted>
Signed-off-by: Junio C Hamano <redacted>
Nguyễn Thái Ngọc Duy [Thu, 3 Mar 2011 12:34:51 +0000 (19:34 +0700)]
init: remove unnecessary check
git_dir must always be non-NULL so "if (git_dir)" is unnecessary.
Before this code, if git_dir == NULL, it will default to
DEFAULT_GIT_DIR_ENVIRONMENT.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Matthieu Moy [Wed, 2 Mar 2011 20:12:11 +0000 (21:12 +0100)]
push: better error message when no remote configured
Signed-off-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Matthieu Moy [Wed, 2 Mar 2011 20:12:10 +0000 (21:12 +0100)]
push: better error messages when push.default = tracking
A common scenario is to create a new branch and push it (checkout -b &&
push [--set-upstream]). In this case, the user was getting "The current
branch %s has no upstream branch.", which doesn't help much.
Provide the user a command to push the current branch. To avoid the
situation in the future, suggest --set-upstream.
While we're there, also improve the error message in the "detached HEAD"
case. We mention explicitly "detached HEAD" since this is the keyword to
look for in documentations.
Signed-off-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 2 Mar 2011 23:26:44 +0000 (15:26 -0800)]
Merge branch 'maint'
* maint:
verify-pack: add --stat-only to the synopsis section
Uwe Kleine-König [Tue, 1 Mar 2011 09:21:37 +0000 (10:21 +0100)]
git-request-pull: open-code the only invocation of get_remote_url
So sh:get_remote_url can go now and git-request-pull
doesn't need to source git-parse-remote. anymore.
Signed-off-by: Uwe Kleine-König <redacted>
Signed-off-by: Junio C Hamano <redacted>
Uwe Kleine-König [Tue, 1 Mar 2011 09:21:36 +0000 (10:21 +0100)]
get_remote_url(): use the same data source as ls-remote to get remote urls
The formerly implemented algorithm behaved differently to
remote.c:remote_get() at least for remotes that contain a slash. While the
former just assumes a/b is a path the latter checks the config for
remote."a/b" first which is more reasonable.
This removes the last user of git-parse-remote.sh:get_data_source(), so
this function is removed.
Signed-off-by: Uwe Kleine-König <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Sixt [Tue, 1 Mar 2011 13:21:05 +0000 (14:21 +0100)]
rerere forget: deprecate invocation without pathspec
rerere forget is a destructive command. When invoked without a path, it
operates on the current directory, potentially deleting many recorded
conflict resolutions.
To make the command safer, a path must be specified as of git 1.8.0. Until
then, give users time to write 'git rerere forget .' if they really mean
the entire current directory.
Signed-off-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Tue, 1 Mar 2011 01:08:52 +0000 (18:08 -0700)]
merge-recursive: When we detect we can skip an update, actually skip it
In
882fd11 (merge-recursive: Delay content merging for renames 2010-09-20),
there was code that checked for whether we could skip updating a file in
the working directory, based on whether the merged version matched the
current working copy. Due to the desire to handle directory/file conflicts
that were resolvable, that commit deferred content merging by first
updating the index with the unmerged entries and then moving the actual
merging (along with the skip-the-content-update check) to another function
that ran later in the merge process. As part moving the content merging
code, a bug was introduced such that although the message about skipping
the update would be printed (whenever GIT_MERGE_VERBOSITY was sufficiently
high), the file would be unconditionally updated in the working copy
anyway.
When we detect that the file does not need to be updated in the working
copy, update the index appropriately and then return early before updating
the working copy.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Tue, 1 Mar 2011 01:08:51 +0000 (18:08 -0700)]
t6022: New test checking for unnecessary updates of files in D/F conflicts
Reported-by: Stephen Rothwell <redacted>
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Tue, 1 Mar 2011 01:08:50 +0000 (18:08 -0700)]
t6022: New test checking for unnecessary updates of renamed+modified files
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Shawn O. Pearce [Wed, 2 Mar 2011 18:01:54 +0000 (10:01 -0800)]
sha1_file.c: Don't retain open fds on small packs
If a pack file is small enough that its entire contents fits within
one mmap window, mmap the file and then immediately close its file
descriptor. This reduces the number of file descriptors that are
needed to read from repositories with many tiny pack files, such
as one that has received 1000 pushes (and created 1000 small pack
files) since its last repack.
Signed-off-by: Shawn O. Pearce <redacted>
Signed-off-by: Junio C Hamano <redacted>
Erik Faye-Lund [Mon, 28 Feb 2011 21:13:22 +0000 (22:13 +0100)]
mingw: add minimum getrlimit() compatibility stub
We don't have getrlimit on Windows :( Limit of 2048 taken from MSDN:
http://msdn.microsoft.com/en-us/library/
6e3b887c(v=vs.71).aspx
Signed-off-by: Erik Faye-Lund <redacted>
Junio C Hamano [Tue, 1 Mar 2011 19:26:22 +0000 (11:26 -0800)]
verify-pack: add --stat-only to the synopsis section
Signed-off-by: Junio C Hamano <redacted>
Avery Pennarun [Tue, 1 Mar 2011 04:48:50 +0000 (20:48 -0800)]
Skip commit objects that should be trees, rather than copying them.
An improvement on the previous patch, based on more reports from Sum-Wai
Low.
Avery Pennarun [Tue, 1 Mar 2011 00:49:42 +0000 (16:49 -0800)]
It's also okay if an expected tree object is actually a commit.
...that happens with submodules sometimes, so don't panic.
Reported by Sum-Wai Low.
Junio C Hamano [Tue, 1 Mar 2011 00:33:45 +0000 (16:33 -0800)]
Merge branch 'svn-fe' of git://repo.or.cz/git/jrn
* 'svn-fe' of git://repo.or.cz/git/jrn: (31 commits)
fast-import: make code "-Wpointer-arith" clean
vcs-svn: teach line_buffer about temporary files
vcs-svn: allow input from file descriptor
vcs-svn: allow character-oriented input
vcs-svn: add binary-safe read function
t0081 (line-buffer): add buffering tests
vcs-svn: tweak test-line-buffer to not assume line-oriented input
tests: give vcs-svn/line_buffer its own test script
vcs-svn: make test-line-buffer input format more flexible
vcs-svn: teach line_buffer to handle multiple input files
vcs-svn: collect line_buffer data in a struct
vcs-svn: replace buffer_read_string memory pool with a strbuf
vcs-svn: eliminate global byte_buffer
fast-import: add 'ls' command
vcs-svn: Allow change nodes for root of tree (/)
vcs-svn: Implement Prop-delta handling
vcs-svn: Sharpen parsing of property lines
vcs-svn: Split off function for handling of individual properties
vcs-svn: Make source easier to read on small screens
vcs-svn: More dump format sanity checks
...
Jonathan Nieder [Mon, 28 Feb 2011 21:16:59 +0000 (15:16 -0600)]
fast-import: make code "-Wpointer-arith" clean
The dereference() function to peel a tree-ish and find the underlying
tree expects arithmetic to (void *) to work on byte addresses. We
should be reading the text of objects through a char * anyway.
Noticed-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Shawn O. Pearce [Mon, 28 Feb 2011 20:52:39 +0000 (12:52 -0800)]
Limit file descriptors used by packs
Rather than using 'errno == EMFILE' after a failed open() call
to indicate the process is out of file descriptors and an LRU
pack window should be closed, place a hard upper limit on the
number of open packs based on the actual rlimit of the process.
By using a hard upper limit that is below the rlimit of the current
process it is not necessary to check for EMFILE on every single
fd-allocating system call. Instead reserving 25 file descriptors
makes it safe to assume the system call won't fail due to being over
the filedescriptor limit. Here 25 is chosen as a WAG, but considers
3 for stdin/stdout/stderr, and at least a few for other Git code
to operate on temporary files. An additional 20 is reserved as it
is not known what the C library needs to perform other services on
Git's behalf, such as nsswitch or name resolution.
This fixes a case where running `git gc --auto` in a repository
with more than 1024 packs (but an rlimit of 1024 open fds) fails
due to the temporary output file not being able to allocate a
file descriptor. The output file is opened by pack-objects after
object enumeration and delta compression are done, both of which
have already opened all of the packs and fully populated the file
descriptor table.
Signed-off-by: Shawn O. Pearce <redacted>
Signed-off-by: Junio C Hamano <redacted>
Sebastian Schuberth [Sun, 27 Feb 2011 11:32:46 +0000 (12:32 +0100)]
mergetool--lib: Add Beyond Compare 3 as a tool
Signed-off-by: Sebastian Schuberth <redacted>
Tested-by: Chris Packham <redacted>
Signed-off-by: Junio C Hamano <redacted>
Sebastian Schuberth [Sun, 27 Feb 2011 11:31:37 +0000 (12:31 +0100)]
mergetool--lib: Sort tools alphabetically for easier lookup
Signed-off-by: Sebastian Schuberth <redacted>
Tested-by: Chris Packham <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 28 Feb 2011 20:28:20 +0000 (12:28 -0800)]
Start preparing release notes to 1.7.5
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sat, 26 Feb 2011 00:55:26 +0000 (16:55 -0800)]
index-pack --verify: read anomalous offsets from v2 idx file
A pack v2 .idx file usually records offset using 64-bit representation
only when the offset does not fit within 31-bit, but you can handcraft
your .idx file to record smaller offset using 64-bit, storing all zero
in the upper 4-byte. By inspecting the original idx file when running
index-pack --verify, encode such low offsets that do not need to be in
64-bit but are encoded using 64-bit just like the original idx file so
that we can still validate the pack/idx pair by comparing the idx file
recomputed with the original.
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sat, 26 Feb 2011 00:54:00 +0000 (16:54 -0800)]
write_idx_file: need_large_offset() helper function
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Thu, 3 Feb 2011 01:29:01 +0000 (17:29 -0800)]
index-pack: --verify
Given an existing .pack file and the .idx file that describes it,
this new mode of operation reads and re-index the packfile and makes
sure the existing .idx file matches the result byte-for-byte.
All the objects in the .pack file are validated during this operation as
well. Unlike verify-pack, which visits each object described in the .idx
file in the SHA-1 order, index-pack efficiently exploits the delta-chain
to avoid rebuilding the objects that are used as the base of deltified
objects over and over again while validating the objects, resulting in
much quicker verification of the .pack file and its .idx file.
This version however cannot verify a .pack/.idx pair with a handcrafted v2
index that uses 64-bit offset representation for offsets that would fit
within 31-bit. You can create such an .idx file by giving a custom offset
to --index-version option to the command.
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Fri, 25 Feb 2011 23:43:25 +0000 (15:43 -0800)]
write_idx_file: introduce a struct to hold idx customization options
Remove two globals, pack_idx_default version and pack_idx_off32_limit,
and place them in a pack_idx_option structure. Allow callers to pass
it to write_idx_file() as a parameter.
Adjust all callers to the API change.
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 2 Feb 2011 18:06:51 +0000 (10:06 -0800)]
index-pack: group the delta-base array entries also by type
Entries in the delta_base array are only grouped by the bytepattern in
the delta_base union, some of which have 20-byte object name of the base
object (i.e. base for REF_DELTA objects), while others have sizeof(off_t)
bytes followed by enough NULs to fill 20-byte. The loops to iterate
through a range inside this array still needs to inspect the type of the
delta, and skip over false hits.
Group the entries also by type to eliminate the potential of false hits.
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Sat, 26 Feb 2011 22:32:33 +0000 (23:32 +0100)]
git-instaweb: Change how gitweb.psgi is made runnable as standalone app
According to blog post "FindBin, __FILE__, $0 and PSGI woes"
http://bulknews.typepad.com/blog/2011/02/findbin-__file__-0-and-psgi-woes.html
by Tatsuhiko Miyagawa, using 'if (__FILE__ eq $0)' in .psgi code
(to check if script was run from command line), is not supposed to work
since Plack 0.9971.
Replace it with one of proposed solutions; while at it return $app
explicitely, rather than implicitely by being a last expression.
This affects 'plackup' web server.
While at it cleanup whitespace.
Signed-off-by: Jakub Narebski <redacted>
Acked-by: Eric Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 28 Feb 2011 05:58:31 +0000 (21:58 -0800)]
Merge branch 'jh/push-default-upstream-configname'
* jh/push-default-upstream-configname:
push.default: Rename 'tracking' to 'upstream'
Junio C Hamano [Mon, 28 Feb 2011 05:58:31 +0000 (21:58 -0800)]
Merge branch 'lp/config-vername-check'
* lp/config-vername-check:
Disallow empty section and variable names
Sanity-check config variable names
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'mg/placeholders-are-lowercase'
* mg/placeholders-are-lowercase:
Make <identifier> lowercase in Documentation
Make <identifier> lowercase as per CodingGuidelines
Make <identifier> lowercase as per CodingGuidelines
Make <identifier> lowercase as per CodingGuidelines
CodingGuidelines: downcase placeholders in usage messages
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'mg/patch-id'
* mg/patch-id:
git-patch-id: do not trip over "no newline" markers
git-patch-id: test for "no newline" markers
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'mz/rerere-remaining'
* mz/rerere-remaining:
mergetool: don't skip modify/remove conflicts
rerere "remaining"
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'nd/sorted-builtin-command-list'
* nd/sorted-builtin-command-list:
git.c: reorder builtin command list
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'js/maint-merge-use-prepare-commit-msg-hook'
* js/maint-merge-use-prepare-commit-msg-hook:
merge: honor prepare-commit-msg hook
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'nd/hash-object-sanity'
* nd/hash-object-sanity:
Make hash-object more robust against malformed objects
Conflicts:
cache.h
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'js/detach-doc'
* js/detach-doc:
git-checkout.txt: improve detached HEAD documentation
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'va/p4'
* va/p4:
git-p4: Add copy detection support
git-p4: Improve rename detection support
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'pw/p4'
* pw/p4:
git-p4: support clone --bare
git-p4: decode p4 wildcard characters
git-p4: better message for "git-p4 sync" when not cloned
git-p4: reinterpret confusing p4 message
git-p4: accommodate new move/delete type in p4
git-p4: add missing newline in initial import message
git-p4: fix key error for p4 problem
git-p4: test script
Junio C Hamano [Mon, 28 Feb 2011 05:58:29 +0000 (21:58 -0800)]
Merge branch 'uk/checkout-ambiguous-ref'
* uk/checkout-ambiguous-ref:
Rename t2019 with typo "amiguous" that meant "ambiguous"
checkout: rearrange update_refs_for_switch for clarity
checkout: introduce --detach synonym for "git checkout foo^{commit}"
checkout: split off a function to peel away branchname arg
checkout: fix bug with ambiguous refs
Conflicts:
builtin/checkout.c
Junio C Hamano [Mon, 28 Feb 2011 05:58:29 +0000 (21:58 -0800)]
Merge branch 'sp/maint-smart-http-sans-100-continue'
* sp/maint-smart-http-sans-100-continue:
smart-http: Don't use Expect: 100-Continue
Junio C Hamano [Mon, 28 Feb 2011 05:58:28 +0000 (21:58 -0800)]
Merge branch 'mo/perl-bidi-pipe-envfix'
* mo/perl-bidi-pipe-envfix:
perl: command_bidi_pipe() method should set-up git environmens
Junio C Hamano [Mon, 28 Feb 2011 05:17:37 +0000 (21:17 -0800)]
Merge branch 'hv/mingw-fs-funnies'
* hv/mingw-fs-funnies:
mingw_rmdir: set errno=ENOTEMPTY when appropriate
mingw: add fallback for rmdir in case directory is in use
mingw: make failures to unlink or move raise a question
mingw: work around irregular failures of unlink on windows
mingw: move unlink wrapper to mingw.c
Junio C Hamano [Mon, 28 Feb 2011 05:17:36 +0000 (21:17 -0800)]
Merge branch 'en/object-list-with-pathspec'
* en/object-list-with-pathspec:
Add testcases showing how pathspecs are handled with rev-list --objects
Make rev-list --objects work together with pathspecs
Junio C Hamano [Mon, 28 Feb 2011 05:17:36 +0000 (21:17 -0800)]
Merge branch 'nd/struct-pathspec'
* nd/struct-pathspec: (22 commits)
t6004: add pathspec globbing test for log family
t7810: overlapping pathspecs and depth limit
grep: drop pathspec_matches() in favor of tree_entry_interesting()
grep: use writable strbuf from caller for grep_tree()
grep: use match_pathspec_depth() for cache/worktree grepping
grep: convert to use struct pathspec
Convert ce_path_match() to use match_pathspec_depth()
Convert ce_path_match() to use struct pathspec
struct rev_info: convert prune_data to struct pathspec
pathspec: add match_pathspec_depth()
tree_entry_interesting(): optimize wildcard matching when base is matched
tree_entry_interesting(): support wildcard matching
tree_entry_interesting(): fix depth limit with overlapping pathspecs
tree_entry_interesting(): support depth limit
tree_entry_interesting(): refactor into separate smaller functions
diff-tree: convert base+baselen to writable strbuf
glossary: define pathspec
Move tree_entry_interesting() to tree-walk.c and export it
tree_entry_interesting(): remove dependency on struct diff_options
Convert struct diff_options to use struct pathspec
...
Jakub Narebski [Sun, 27 Feb 2011 16:58:32 +0000 (17:58 +0100)]
gitweb: Make i18n (encoding) tests in t9500 leave clean state
The most important issue is that after unsetting `i18n.commitencoding'
config variable t9500 no longer will use author and comitter name
containing ISO-8859-1 characters, which are invalid UTF-8 characters.
Besides it is good practice in general to clean up the state in tests.
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael J Gruber [Sun, 27 Feb 2011 15:50:10 +0000 (16:50 +0100)]
git-add: make -A description clearer vs. -u
Currently, it sounds as if "notice removal of files" distinguishes "-A"
from "-u", and there is no mention of the worktree.
But both notice the removal, and only "-A" adds changes from untracked
files. Say so.
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Fabian Keil [Mon, 31 Jan 2011 19:29:46 +0000 (20:29 +0100)]
git-cvsimport.perl: Bail out right away when reading from the server fails
If the CVS server is down, this reduced the git-cvsimport output from:
ssh: connect to host ijbswa.cvs.sourceforge.net port 22: Connection refused
Use of uninitialized value $rep in scalar chomp at /usr/local/libexec/git-core/git-cvsimport line 369.
Use of uninitialized value $rep in substitution (s///) at /usr/local/libexec/git-core/git-cvsimport line 370.
Expected Valid-requests from server, but got: <unknown>
to the less noisy:
ssh: connect to host ijbswa.cvs.sourceforge.net port 22: Connection refused
Failed to read from server at /usr/local/libexec/git-core/git-cvsimport line 370.
In this case a silent exit() instead of the die() would probably do,
but I assume that there could be cases where the connection attempt
succeeds, but reading from the server fails for other reasons.
Signed-off-by: Fabian Keil <redacted>
Signed-off-by: Junio C Hamano <redacted>
Nguyễn Thái Ngọc Duy [Mon, 6 Sep 2010 10:37:10 +0000 (20:37 +1000)]
doc: technical details about the index file format
This bases on the original work by Robin Rosenberg.
Signed-off-by: Robin Rosenberg <redacted>
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sun, 27 Feb 2011 08:52:15 +0000 (00:52 -0800)]
Merge branch 'maint'
* maint:
branch_merged: fix grammar in warning
Sebastian Schuberth [Sat, 26 Feb 2011 10:52:17 +0000 (11:52 +0100)]
mergetool--lib: Add Beyond Compare 3 as a tool
Signed-off-by: Sebastian Schuberth <redacted>
Signed-off-by: Junio C Hamano <redacted>
Sebastian Schuberth [Sat, 26 Feb 2011 10:51:14 +0000 (11:51 +0100)]
mergetool--lib: Sort tools alphabetically for easier lookup
Signed-off-by: Sebastian Schuberth <redacted>
Signed-off-by: Junio C Hamano <redacted>
Eric Hanchrow [Sat, 26 Feb 2011 03:29:42 +0000 (19:29 -0800)]
branch_merged: fix grammar in warning
Signed-off-by: Eric Hanchrow <redacted>
Helped-by: Jay Soffian <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Sat, 26 Feb 2011 11:21:29 +0000 (05:21 -0600)]
Merge commit 'jn/svn-fe' of git://github.com/gitster/git into svn-fe
* git://github.com/gitster/git:
vcs-svn: Allow change nodes for root of tree (/)
vcs-svn: Implement Prop-delta handling
vcs-svn: Sharpen parsing of property lines
vcs-svn: Split off function for handling of individual properties
vcs-svn: Make source easier to read on small screens
vcs-svn: More dump format sanity checks
vcs-svn: Reject path nodes without Node-action
vcs-svn: Delay read of per-path properties
vcs-svn: Combine repo_replace and repo_modify functions
vcs-svn: Replace = Delete + Add
vcs-svn: handle_node: Handle deletion case early
vcs-svn: Use mark to indicate nodes with included text
vcs-svn: Unclutter handle_node by introducing have_props var
vcs-svn: Eliminate node_ctx.mark global
vcs-svn: Eliminate node_ctx.srcRev global
vcs-svn: Check for errors from open()
vcs-svn: Allow simple v3 dumps (no deltas yet)
Conflicts:
t/t9010-svn-fe.sh
vcs-svn/svndump.c
Jonathan Nieder [Mon, 3 Jan 2011 03:10:59 +0000 (21:10 -0600)]
vcs-svn: teach line_buffer about temporary files
It can sometimes be useful to write information temporarily to file,
to read back later. These functions allow a program to use the
line_buffer facilities when doing so.
It works like this:
1. find a unique filename with buffer_tmpfile_init.
2. rewind with buffer_tmpfile_rewind. This returns a stdio
handle for writing.
3. when finished writing, declare so with
buffer_tmpfile_prepare_to_read. The return value indicates
how many bytes were written.
4. read whatever portion of the file is needed.
5. if finished, remove the temporary file with buffer_deinit.
otherwise, go back to step 2,
The svn support would use this to buffer the postimage from delta
application until the length is known and fast-import can receive
the resulting blob.
Based-on-patch-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 3 Jan 2011 03:09:38 +0000 (21:09 -0600)]
vcs-svn: allow input from file descriptor
Based-on-patch-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 3 Jan 2011 03:06:32 +0000 (21:06 -0600)]
vcs-svn: allow character-oriented input
buffer_read_char can be used in place of buffer_read_string(1) to
avoid consuming valuable static buffer space. The delta applier will
use this to read variable-length integers one byte at a time.
Underneath, it is fgetc, wrapped so the line_buffer library can
maintain its role as gatekeeper of input.
Later it might be worth checking if fgetc_unlocked is faster ---
most line_buffer functions are not thread-safe anyway.
Helpd-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 3 Jan 2011 03:05:46 +0000 (21:05 -0600)]
vcs-svn: add binary-safe read function
buffer_read_string works well for non line-oriented input except for
one problem: it does not tell the caller how many bytes were actually
written. This means that unless one is very careful about checking
for errors (and eof) the calling program cannot tell the difference
between the string "foo" followed by an early end of file and the
string "foo\0bar\0baz".
So introduce a variant that reports the length, too, a thinner wrapper
around strbuf_fread. Its result is written to a strbuf so the caller
does not need to keep track of the number of bytes read.
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 3 Jan 2011 01:07:16 +0000 (19:07 -0600)]
t0081 (line-buffer): add buffering tests
POSIX makes the behavior of read(2) from a pipe fairly clear: a read
from an empty pipe will block until there is data available and any
other read will not block, prefering to return a partial result.
Likewise, fread(3) and fgets(3) are clearly specified to act as
though implemented by calling fgetc(3) in a simple loop. But the
buffering behavior of fgetc is less clear.
Luckily, no sane platform is going to implement fgetc by calling the
equivalent of read(2) more than once. fgetc has to be able to
return without filling its buffer to preserve errno when errors are
encountered anyway. So let's assume the simpler behavior (trust) but
add some tests to catch insane platforms that violate that when they
come (verify).
First check that fread can handle a 0-length read from an empty fifo.
Because open(O_RDONLY) blocks until the writing end is open, open the
writing end of the fifo in advance in a subshell.
Next try short inputs from a pipe that is not filled all the way.
Lastly (two tests) try very large inputs from a pipe that will not fit
in the relevant buffers. The first of these tests reads a little
more than 8192 bytes, which is BUFSIZ (the size of stdio's buffers)
on this Linux machine. The second reads a little over 64 KiB (the
pipe capacity on Linux) and is not run unless requested by setting
the GIT_REMOTE_SVN_TEST_BIG_FILES environment variable.
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 3 Jan 2011 00:52:28 +0000 (18:52 -0600)]
vcs-svn: tweak test-line-buffer to not assume line-oriented input
Do not expect an implicit newline after each input record.
Use a separate command to exercise buffer_skip_bytes.
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 3 Jan 2011 00:51:07 +0000 (18:51 -0600)]
tests: give vcs-svn/line_buffer its own test script
Split the line_buffer test into small pieces and move it to its
own file as preparation for adding more tests.
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 3 Jan 2011 00:50:16 +0000 (18:50 -0600)]
vcs-svn: make test-line-buffer input format more flexible
Imitate the input format of test-obj-pool to support arbitrary
sequences of commands rather than alternating read/copy. This should
make it easier to add tests that exercise other line_buffer functions.
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 11 Oct 2010 02:41:06 +0000 (21:41 -0500)]
vcs-svn: teach line_buffer to handle multiple input files
Collect the line_buffer state in a newly public line_buffer struct.
Callers can use multiple line_buffers to manage input from multiple
files at a time.
svn-fe's delta applier will use this to stream a delta from svnrdump
and the preimage it applies to from fast-import at the same time.
The tests don't take advantage of the new features, but I think that's
okay. It is easier to find lingering examples of nonreentrant code by
searching for "static" in line_buffer.c.
Signed-off-by: Jonathan Nieder <redacted>
David Barr [Thu, 2 Dec 2010 10:40:20 +0000 (21:40 +1100)]
fast-import: add 'ls' command
Lazy fast-import frontend authors that want to rely on the backend to
keep track of the content of the imported trees _almost_ have what
they need in the 'cat-blob' command (v1.7.4-rc0~30^2~3, 2010-11-28).
But it is not quite enough, since
(1) cat-blob can be used to retrieve the content of files, but
not their mode, and
(2) using cat-blob requires the frontend to keep track of a name
(mark number or object id) for each blob to be retrieved
Introduce an 'ls' command to complement cat-blob and take care of the
remaining needs. The 'ls' command finds what is at a given path
within a given tree-ish (tag, commit, or tree):
'ls' SP <dataref> SP <path> LF
or in fast-import's active commit:
'ls' SP <path> LF
The response is a single line sent through the cat-blob channel,
imitating ls-tree output. So for example:
FE> ls :1 Documentation
gfi> 040000 tree
9e6c2b599341d28a2a375f8207507e0a2a627fe9 Documentation
FE> ls
9e6c2b599341d28a2a375f8207507e0a2a627fe9 git-fast-import.txt
gfi> 100644 blob
4f92954396e3f0f97e75b6838a5635b583708870 git-fast-import.txt
FE> ls :1 RelNotes
gfi> 120000 blob
b942e499449d97aeb50c73ca2bdc1c6e6d528743 RelNotes
FE> cat-blob
b942e499449d97aeb50c73ca2bdc1c6e6d528743
gfi>
b942e499449d97aeb50c73ca2bdc1c6e6d528743 blob 32
gfi> Documentation/RelNotes/1.7.4.txt
The most interesting parts of the reply are the first word, which is
a 6-digit octal mode (regular file, executable, symlink, directory,
or submodule), and the part from the second space to the tab, which is
a <dataref> that can be used in later cat-blob, ls, and filemodify (M)
commands to refer to the content (blob, tree, or commit) at that path.
If there is nothing there, the response is "missing some/path".
The intent is for this command to be used to read files from the
active commit, so a frontend can apply patches to them, and to copy
files and directories from previous revisions.
For example, proposed updates to svn-fe use this command in place of
its internal representation of the repository directory structure.
This simplifies the frontend a great deal and means support for
resuming an import in a separate fast-import run (i.e., incremental
import) is basically free.
Signed-off-by: David Barr <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Improved-by: Junio C Hamano <redacted>
Improved-by: Sverre Rabbelier <redacted>
Jonathan Nieder [Mon, 11 Oct 2010 02:39:21 +0000 (21:39 -0500)]
vcs-svn: collect line_buffer data in a struct
Prepare for the line_buffer lib to support input from multiple files,
by collecting global state in a struct that can be easily passed
around.
No API change yet.
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Sat, 6 Nov 2010 17:01:28 +0000 (12:01 -0500)]
vcs-svn: replace buffer_read_string memory pool with a strbuf
obj_pool is inherently global and does not use the standard growing
factor alloc_nr, which makes it feel out of place in the git codebase.
Plus it is overkill for this application: all that is needed is a
buffer that can grow between requests to accomodate larger strings.
Use a strbuf instead.
As a side effect, this improves the error handling: allocation
failures will result in a clean exit instead of segfaults. It would
be nice to add a test case (using ulimit or failmalloc) but that can
wait for another day.
Signed-off-by: Jonathan Nieder <redacted>
Jonathan Nieder [Mon, 11 Oct 2010 02:37:10 +0000 (21:37 -0500)]
vcs-svn: eliminate global byte_buffer
The data stored in byte_buffer[] is always either discarded or
written to stdout immediately. No need for it to persist between
function calls.
Signed-off-by: Jonathan Nieder <redacted>
Jeff King [Sat, 26 Feb 2011 05:08:53 +0000 (23:08 -0600)]
strbuf: add strbuf_vaddf
In a variable-args function, the code for writing into a strbuf is
non-trivial. We ended up cutting and pasting it in several places
because there was no vprintf-style function for strbufs (which in turn
was held up by a lack of va_copy).
Now that we have a fallback va_copy, we can add strbuf_vaddf, the
strbuf equivalent of vsprintf. And we can clean up the cut and paste
mess.
Signed-off-by: Jeff King <redacted>
Improved-by: Christian Couder <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Sat, 26 Feb 2011 05:08:25 +0000 (23:08 -0600)]
compat: provide a fallback va_copy definition
va_copy is C99. We have avoided using va_copy many times in the past,
which has led to a bunch of cut-and-paste. From everything I found
searching the web, implementations have historically either provided
va_copy or just let your code assume that simple assignment of worked.
So my guess is that this will be sufficient, though we won't really
know for sure until somebody reports a problem.
Signed-off-by: Jeff King <redacted>
Improved-by: Erik Faye-Lund <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael Horowitz [Sat, 26 Feb 2011 02:31:13 +0000 (21:31 -0500)]
git-p4 submit: prevent 'Jobs' section from being removed from p4 change log
In an attempt to overwrite the 'Description:' section of the p4 change
log to include the git commit messages, it also overwrote the 'Jobs:'
section. Â This fix restores the 'Job:' section.
Signed-off-by: Michael Horowitz <redacted>
Signed-off-by: Junio C Hamano <redacted>
Martin von Zweigbergk [Fri, 25 Feb 2011 03:32:06 +0000 (22:32 -0500)]
Makefile: do not install sourced rebase scripts
When git-rebase.sh recently started sourcing
git-rebase--interactive.sh instead of executing it, executable bit of
the latter file should have been turned off and it should have been
moved from SCRIPT_SH to SCRIPT_LIB in the Makefile. Its two new
siblings, git-rebase--am.sh and git-rebase--merge.sh (whose executable
bits are already off) should also be moved to SCRIPT_LIB in the
Makefile.
Reported-by: Johannes Sixt <redacted>
Helped-by: Jeff King <redacted>
Signed-off-by: Martin von Zweigbergk <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Fri, 25 Feb 2011 09:07:57 +0000 (03:07 -0600)]
commit: error out for missing commit message template
When "git commit" was rewritten in C (v1.5.4-rc0~78^2~30,
2007-11-08), a subtle bug in --template was introduced. If the
file named by a --template parameter is missing, previously git
would error out with a message:
Commit template file does not exist.
but in the C version the --template parameter gets ignored and
the default template is used.
t7500 has two tests for this case which would have caught it, except
that with the default $EDITOR, the commit message template is left
unmodified, causing 'git commit' to error out and the test to
succeed.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael J Gruber [Fri, 25 Feb 2011 09:36:39 +0000 (10:36 +0100)]
mergetool-lib: call vim in readonly mode for diffs
When [g]vimdiff is called for files which are opened already, the editor
complains about the existing swap file. But we do not want to write
anything when called from difftool. So, make difftool use "-R" for the
vim family. This
- prevents the use of a swap file and
- marks the buffers readonly.
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sat, 19 Feb 2011 00:04:47 +0000 (16:04 -0800)]
commit: give final warning when reattaching HEAD to leave commits behind
You can detach the HEAD at an arbitrary commit in order to browse the
files in various points in the history or build older versions of the
software, without recording any new commit, and come back to an existing
branch. When used in this "sightseer" mode, detached HEAD is a perfectly
safe mechanism. It also is a useful state to experiment with throw-away
commits.
When coming back to an existing branch with "git checkout master",
however, the commits that were created on the detached HEAD will become
unreachable from anywhere but the reflog of the HEAD. Check if the commit
we are about to leave is connected to some ref, and give a final warning
otherwise to remind the user for safety.
Signed-off-by: Junio C Hamano <redacted>
Heiko Voigt [Tue, 22 Feb 2011 19:30:21 +0000 (20:30 +0100)]
git-gui: fetch/prune all entry appears last
The user might have got used to the order the remotes appeared previously.
Lets add the all entry last so the all entry does not confuse previous
users.
Signed-off-by: Heiko Voigt <redacted>
Tested-by: Jens Lehmann <redacted>
Signed-off-by: Pat Thoyts <redacted>
Heiko Voigt [Tue, 22 Feb 2011 19:28:36 +0000 (20:28 +0100)]
git-gui: fetch/prune all entry only for more than one entry
In case there is only one remote a fetch/prune all entry
is redundant.
Signed-off-by: Heiko Voigt <redacted>
Tested-by: Jens Lehmann <redacted>
Signed-off-by: Pat Thoyts <redacted>
Jeff King [Wed, 23 Feb 2011 09:59:18 +0000 (04:59 -0500)]
format-patch: rfc2047-encode newlines in headers
These should generally never happen, as we already
concatenate multiples in subjects into a single line. But
let's be defensive, since not encoding them means we will
output malformed headers.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Wed, 23 Feb 2011 09:58:41 +0000 (04:58 -0500)]
format-patch: wrap long header lines
Subject and identity headers may be arbitrarily long. In the
past, we just assumed that single-line headers would be
reasonably short. For multi-line subjects that we squish
into a single line, we just "pre-folded" the data in
pp_title_line by adding a newline and indentation.
There were two problems. One is that, although rare,
single-line messages can actually be longer than the
recommended line-length limits. The second is that the
pre-folding interacted badly with rfc2047 encoding, leading
to malformed headers.
Instead, let's stop pre-folding the subject lines, and just
fold everything based on length in add_rfc2047, whether
it is encoded or not.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jeff King [Wed, 23 Feb 2011 09:50:19 +0000 (04:50 -0500)]
strbuf: add fixed-length version of add_wrapped_text
The function strbuf_add_wrapped_text takes a NUL-terminated
string. This makes it annoying to wrap strings we have as a
pointer and a length.
Refactoring strbuf_add_wrapped_text and all of its
sub-functions to handle fixed-length strings turned out to
be really ugly. So this implementation is lame; it just
strdups the text and operates on the NUL-terminated version.
This should be fine as the strings we are wrapping are
generally pretty short. If it becomes a problem, we can
optimize later.
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>