Mike Hommey [Sat, 6 Jun 2009 08:43:55 +0000 (16:43 +0800)]
http.c::http_fetch_ref(): use the new http API
The error message ("Unable to start request") has been removed, since
the http API already prints it.
Signed-off-by: Mike Hommey <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Mike Hommey [Sat, 6 Jun 2009 08:43:54 +0000 (16:43 +0800)]
transport.c::get_refs_via_curl(): use the new http API
Signed-off-by: Mike Hommey <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Mike Hommey [Sat, 6 Jun 2009 08:43:53 +0000 (16:43 +0800)]
http.c: new functions for the http API
The new functions added are:
- http_request() (internal function)
- http_get_strbuf()
- http_get_file()
- http_error()
http_get_strbuf and http_get_file allow respectively to retrieve contents of
an URL to a strbuf or an opened file handle.
http_error prints out an error message containing the URL and the curl error
(in curl_errorstr).
Signed-off-by: Mike Hommey <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:43 +0000 (16:43 +0800)]
http: create function end_url_with_slash
The logic to append a slash to the url if necessary in quote_ref_url
(added in
113106e "http.c: use strbuf API in quote_ref_url") has been
moved to a new function, end_url_with_slash.
The method takes a strbuf, the URL, and the path to be appended to the
URL. It first adds the URL to the strbuf. It then appends a slash
if the URL does not end with a slash.
The check on ref in quote_ref_url for a slash at the beginning has been
removed as a result of using end_url_with_slash. This check is not
needed, because slashes will be quoted anyway.
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:41 +0000 (16:43 +0800)]
http*: move common variables and macros to http.[ch]
Move RANGE_HEADER_SIZE to http.h.
Create no_pragma_header, the curl header list containing the header
"Pragma:" in http.[ch]. It is allocated in http_init, and freed in
http_cleanup. This replaces the no_pragma_header in http-push.c, and
the no_pragma_header member in walker_data in http-walker.c.
Create http_is_verbose. It is to be used by methods in http.c, and is
modified at the entry points of http.c's users, namely http-push.c
(when parsing options) and http-walker.c (in get_http_walker).
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Mike Hommey [Sat, 6 Jun 2009 08:43:40 +0000 (16:43 +0800)]
transport.c::get_refs_via_curl(): do not leak refs_url
Signed-off-by: Mike Hommey <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Mike Hommey [Sun, 18 Jan 2009 08:04:26 +0000 (09:04 +0100)]
Don't expect verify_pack() callers to set pack_size
Since use_pack() will end up populating pack_size if it is not already set,
we can just adapt the code in verify_packfile() such that it doesn't require
pack_size to be set beforehand.
This allows callers not to have to set pack_size themselves, and we can thus
revert changes from
1c23d794 (Don't die in git-http-fetch when fetching packs).
Signed-off-by: Mike Hommey <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:37 +0000 (16:43 +0800)]
http-push: do not SEGV after fetching a bad pack idx file
In
a70c232 ("http-fetch: do not SEGV after fetching a bad pack idx
file"), changes were made to the setup_index method in http-fetch.c
(known in its present form as http-walker.c after
30ae764 ("Modularize
commit-walker")). Since http-push.c has similar similar code for
processing index files, these changes should apply to http-push.c's
implementation of setup_index as well.
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:36 +0000 (16:43 +0800)]
http*: copy string returned by sha1_to_hex
In the fetch_index implementations in http-push.c and http-walker.c,
the string returned by sha1_to_hex is assumed to stay immutable.
This patch ensures that hex stays immutable by copying the string
returned by sha1_to_hex (via xstrdup) and frees it subsequently. It
also refactors free()'s and fclose()'s with labels.
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:34 +0000 (16:43 +0800)]
http-walker: verify remote packs
In
c17fb6e ("Verify remote packs, speed up pending request queue"),
changes were made to index fetching in http-push.c, particularly the
methods fetch_index and setup_index. Since http-walker.c has similar
code for index fetching, these improvements should apply to
http-walker.c's fetch_index and setup_index.
Invocations of free() of string memory are reproduced as well.
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:33 +0000 (16:43 +0800)]
http-push, http-walker: style fixes
- Use tabs to indent, instead of spaces.
- Do not use curly-braces around a single statement body in
if/while statement;
- Do not start multi-line comment with description on the first
line after "/*", i.e.
/*
* We prefer this over...
*/
/* comments like
* this (notice the first line)
*/
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:32 +0000 (16:43 +0800)]
t5550-http-fetch: test fetching of packed objects
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:31 +0000 (16:43 +0800)]
http-push: fix missing "#ifdef USE_CURL_MULTI" around "is_running_queue"
As it is breaking the build when USE_CURL_MULTI is not defined.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:27 +0000 (16:43 +0800)]
http-push: send out fetch requests on queue
Previously, requests for remote files were simply added to the queue
(pointed to by request_queue_head) and no transfer actually takes
place (the fill function add_fill_function() is not added until line
2441), even though code that followed may rely on these remote files to
be present (eg. the setup_revisions invocation).
The code that sends out the requests on the request queue is refactored
into the method run_request_queue.
After the get_dav_remote_heads invocation (ie. after fetch requests are
added to the queue), the requests on the queue are sent out through an
invocation to run_request_queue.
This invocation to run_request_queue entails adding a fill function
before pushing checks take place, which may lead to accidental,
unwanted pushes previously.
The flag is_running_queue is introduced to prevent this from occurring.
fill_active_slot is made to check the flag is_running_queue before
the sending of the requests proceeds.
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:24 +0000 (16:43 +0800)]
t5540-http-push: test fetching of packed objects
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:23 +0000 (16:43 +0800)]
t5540-http-push: test fetching of loose objects
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sat, 6 Jun 2009 17:56:17 +0000 (10:56 -0700)]
Merge branch 'rc/maint-http-local-slot-fix' into rc/http-push
* rc/maint-http-local-slot-fix:
http*: cleanup slot->local after fclose
Tay Ray Chuan [Sat, 6 Jun 2009 08:43:26 +0000 (16:43 +0800)]
http*: cleanup slot->local after fclose
Set slot->local to NULL after doing a fclose() on the file it points
to. This prevents the passing of a FILE* pointer to a fclose()'d file
to ftell() in http.c::run_active_slot().
This issue was raised by Clemens Buchacher on 30th May 2009:
http://www.spinics.net/lists/git/msg104623.html
Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Thu, 4 Jun 2009 05:52:37 +0000 (22:52 -0700)]
Documentation/git.txt: update links to release notes
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Thu, 4 Jun 2009 05:51:56 +0000 (22:51 -0700)]
Merge branch 'maint' to sync with 1.6.3.2
Junio C Hamano [Thu, 4 Jun 2009 05:42:15 +0000 (22:42 -0700)]
GIT 1.6.3.2
Signed-off-by: Junio C Hamano <redacted>
Daniel Trstenjak [Tue, 2 Jun 2009 18:03:22 +0000 (20:03 +0200)]
Show presence of stashed changes in bash prompt.
Add a '$' in the __git_ps1 output to show stashed changes are present,
when GIT_PS1_SHOWSTASHSTATE is set to a nonempty value.
The code for checking if the stash has entries is taken from
'git-stash.sh'.
Signed-off-by: Daniel Trstenjak <redacted>
Acked-by: Shawn O. Pearce <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Wed, 3 Jun 2009 16:19:01 +0000 (18:19 +0200)]
grep: fix empty word-regexp matches
The command "git grep -w ''" dies as soon as it encounters an empty line,
reporting (wrongly) that "regexp returned nonsense". The first hunk of
this patch relaxes the sanity check that is responsible for that,
allowing matches to start at the end.
The second hunk complements it by making sure that empty matches are
rejected if -w was specified, as they are not really words.
GNU grep does the same:
$ echo foo | grep -c ''
1
$ echo foo | grep -c -w ''
0
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 3 Jun 2009 07:50:05 +0000 (00:50 -0700)]
Merge branch 'da/pretty-tempname'
* da/pretty-tempname:
diff: generate pretty filenames in prep_temp_blob()
compat: add a basename() compatibility function
compat: add a mkstemps() compatibility function
Conflicts:
Makefile
Linus Torvalds [Wed, 3 Jun 2009 01:34:01 +0000 (18:34 -0700)]
Clean up and simplify rev_compare_tree()
This simplifies the logic of rev_compare_tree() by removing a special
case.
It does so by turning the special case of finding a diff to be "all new
files" into a more generic case of "all new" vs "all removed" vs "mixed
changes", so now the code is actually more powerful and more generic, and
the added symmetry actually makes it simpler too.
This makes no changes to any existing behavior, but apart from the
simplification it does make it possible to some day care about whether all
changes were just deletions if we want to. Which we may well want to for
merge handling.
Signed-off-by: Linus Torvalds <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 3 Jun 2009 07:49:40 +0000 (00:49 -0700)]
Merge branch 'maint'
* maint:
blame: correctly handle a path that used to be a directory
add -i: do not dump patch during application
Update draft release notes for 1.6.3.2
grep: fix colouring of matches with zero length
Documentation: teach stash/pop workflow instead of stash/apply
Change xdl_merge to generate output even for null merges
t6023: merge-file fails to output anything for a degenerate merge
Junio C Hamano [Wed, 3 Jun 2009 07:43:22 +0000 (00:43 -0700)]
blame: correctly handle a path that used to be a directory
When trying to see if the same path exists in the parent, we ran
"diff-tree" with pathspec set to the path we are interested in with the
parent, and expect either to have exactly one resulting filepair (either
"changed from the parent", "created when there was none") or nothing (when
there is no change from the parent).
If the path used to be a directory, however, we will also see unbounded
number of entries that talk about the files that used to exist underneath
the directory in question. Correctly pick only the entry that describes
the path we are interested in in such a case (namely, the creation of the
path as a regular file).
Noticed by Ben Willard.
Signed-off-by: Junio C Hamano <redacted>
Thomas Rast [Tue, 2 Jun 2009 21:34:27 +0000 (23:34 +0200)]
add -i: do not dump patch during application
Remove a debugging print that snuck in at
7a26e65 (Revert
"git-add--interactive: remove hunk coalescing", 2009-05-16).
Signed-off-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johan Herland [Tue, 2 Jun 2009 22:59:12 +0000 (00:59 +0200)]
git-submodule: add support for --merge.
'git submodule update --merge' merges the commit referenced by the
superproject into your local branch, instead of checking it out on
a detached HEAD.
As evidenced by the addition of "git submodule update --rebase", it
is useful to provide alternatives to the default 'checkout' behaviour
of "git submodule update". One such alternative is, when updating a
submodule to a new commit, to merge that commit into the current
local branch in that submodule. This is useful in workflows where
you want to update your submodule from its upstream, but you cannot
use --rebase, because you have downstream people working on top of
your submodule branch, and you don't want to disrupt their work.
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johan Herland [Wed, 3 Jun 2009 06:27:06 +0000 (08:27 +0200)]
Rename submodule.<name>.rebase to submodule.<name>.update
The addition of "submodule.<name>.rebase" demonstrates the usefulness of
alternatives to the default behaviour of "git submodule update". However,
by naming the config variable "submodule.<name>.rebase", and making it a
boolean choice, we are artificially constraining future git versions that
may want to add _more_ alternatives than just "rebase".
Therefore, while "submodule.<name>.rebase" is not yet in a stable git
release, future-proof it, by changing it from
submodule.<name>.rebase = true/false
to
submodule.<name>.update = rebase/checkout
where "checkout" specifies the default behaviour of "git submodule update"
(checking out the new commit to a detached HEAD), and "rebase" specifies
the --rebase behaviour (where the current local branch in the submodule is
rebase onto the new commit). Thus .update == checkout is equivalent to
.rebase == false, and .update == rebase is equivalent to .rebase == true.
Finally, leaving .update unset is equivalent to leaving .rebase unset.
In future git versions, other alternatives to "git submodule update"
behaviour can be included by adding them to the list of allowable values
for the submodule.<name>.update variable.
Signed-off-by: Johan Herland <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 2 Jun 2009 14:57:39 +0000 (07:57 -0700)]
Update draft release notes for 1.6.3.2
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Tue, 2 Jun 2009 14:48:44 +0000 (07:48 -0700)]
Merge branch 'cb/maint-1.6.0-xdl-merge-fix' into maint
* cb/maint-1.6.0-xdl-merge-fix:
Change xdl_merge to generate output even for null merges
t6023: merge-file fails to output anything for a degenerate merge
Conflicts:
xdiff/xmerge.c
Junio C Hamano [Tue, 2 Jun 2009 14:48:09 +0000 (07:48 -0700)]
Merge branch 'rs/maint-grep-word-regexp-fix' into maint
* rs/maint-grep-word-regexp-fix:
grep: fix colouring of matches with zero length
grep: fix word-regexp at the beginning of lines
Junio C Hamano [Tue, 2 Jun 2009 14:47:03 +0000 (07:47 -0700)]
Merge branch 'sb/maint-1.6.2-opt-filename-fix' into maint
* sb/maint-1.6.2-opt-filename-fix:
apply, fmt-merge-msg: use relative filenames
commit: -F overrides -t
Junio C Hamano [Tue, 2 Jun 2009 14:46:52 +0000 (07:46 -0700)]
Merge branch 'jc/maint-add-p-coalesce-fix' into maint
* jc/maint-add-p-coalesce-fix:
t3701: ensure correctly set up repository after skipped tests
Revert "git-add--interactive: remove hunk coalescing"
Splitting a hunk that adds a line at the top fails in "add -p"
Junio C Hamano [Tue, 2 Jun 2009 14:43:45 +0000 (07:43 -0700)]
Merge branch 'tr/maint-doc-stash-pop' into maint
* tr/maint-doc-stash-pop:
Documentation: teach stash/pop workflow instead of stash/apply
Clemens Buchacher [Mon, 1 Jun 2009 12:28:25 +0000 (14:28 +0200)]
test-lib: fix http exit codes
Previously, die() would report the exit code of stop_httpd. Instead,
save and reset the exit code before dying.
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Mon, 1 Jun 2009 12:14:41 +0000 (14:14 +0200)]
test-lib: allow exit trap to be used for cleanup by tests
Exit trap should not be removed in case tests require cleanup code. This
is especially important if tests are executed with the --immediate option.
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Mon, 1 Jun 2009 12:14:40 +0000 (14:14 +0200)]
test-lib: fail if invalid options are passed
Previously, unknown options would be ignored, including any subsequent
valid options.
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Mon, 1 Jun 2009 21:53:05 +0000 (23:53 +0200)]
grep: fix colouring of matches with zero length
If a zero-length match is encountered, break out of loop and show the rest
of the line uncoloured. Otherwise we'd be looping forever, trying to make
progress by advancing the pointer by zero characters.
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Mon, 1 Jun 2009 09:20:56 +0000 (11:20 +0200)]
refuse to merge during a merge
The following is an easy mistake to make for users coming from version
control systems with an "update and commit"-style workflow.
1. git pull
2. resolve conflicts
3. git pull
Step 3 overrides MERGE_HEAD, starting a new merge with dirty index.
IOW, probably not what the user intended. Instead, refuse to merge
again if a merge is in progress.
Reported-by: Dave Olszewski <redacted>
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Sun, 31 May 2009 14:26:48 +0000 (16:26 +0200)]
match_refs: search ref list tail internally
Avoid code duplication by moving list tail search to match_refs().
This does not change the semantics, except for http-push, which now inserts
to the front of the ref list in order to get rid of the global remote_tail.
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Stephen Boyd [Mon, 1 Jun 2009 06:34:46 +0000 (23:34 -0700)]
git-show-branch.txt: document --date-order option
Copy the description of date-order from rev-list-options.txt, and then
reword it to be commit specific. While we're at it, put <rev> <glob>...
on a new line to not exceed 80 characters.
Signed-off-by: Stephen Boyd <redacted>
Signed-off-by: Junio C Hamano <redacted>
Marius Storm-Olsen [Sun, 31 May 2009 16:15:23 +0000 (18:15 +0200)]
Add custom memory allocator to MinGW and MacOS builds
The standard allocator on Windows is pretty bad prior
to Windows Vista, and nedmalloc is better than the
modified dlmalloc provided with newer versions of the
MinGW libc.
NedMalloc stats in Git
----------------------
All results are the best result out of 3 runs. The
benchmarks have been done on different hardware, so
the repack times are not comparable.
These benchmarks are all based on 'git repack -adf'
on the Linux kernel.
XP
-----------------------------------------------
MinGW Threads Total Time Speed
-----------------------------------------------
3.4.2 (1T) 00:12:28.422
3.4.2 + nedmalloc (1T) 00:07:25.437 1.68x
3.4.5 (1T) 00:12:20.718
3.4.5 + nedmalloc (1T) 00:07:24.809 1.67x
4.3.3-tdm (1T) 00:12:01.843
4.3.3-tdm + nedmalloc (1T) 00:07:16.468 1.65x
4.3.3-tdm (2T) 00:07:35.062
4.3.3-tdm + nedmalloc (2T) 00:04:57.874 1.54x
Vista
-----------------------------------------------
MinGW Threads Total Time Speed
-----------------------------------------------
4.3.3-tdm (1T) 00:07:40.844
4.3.3-tdm + nedmalloc (1T) 00:07:17.548 1.05x
4.3.3-tdm (2T) 00:05:33.746
4.3.3-tdm + nedmalloc (2T) 00:05:27.334 1.02x
Mac Mini
-----------------------------------------------
GCC Threads Total Time Speed
-----------------------------------------------
i686-darwin9-4.0.1 (2T) 00:09:57.346
i686-darwin9-4.0.1+ned (2T) 00:08:51.072 1.12x
Signed-off-by: Marius Storm-Olsen <redacted>
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Junio C Hamano <redacted>
Marius Storm-Olsen [Sun, 31 May 2009 16:15:22 +0000 (18:15 +0200)]
MinGW readdir reimplementation to support d_type
The original readdir implementation was fast, but didn't
support the d_type. This means that git would do additional
lstats for each entry, to figure out if the entry was a
directory or not. This unneedingly slowed down many
operations, since Windows API provides this information
directly when walking the directories.
By running this implementation on Moe's repo structure:
mkdir bummer && cd bummer; for ((i=0;i<100;i++)); do
mkdir $i && pushd $i;
for ((j=0;j<1000;j++)); do echo "$j" >$j; done;
popd;
done
We see the following speedups:
git add .
-------------------
old: 00:00:23(.087)
new: 00:00:21(.512) 1.07x
git status
-------------------
old: 00:00:03(.306)
new: 00:00:01(.684) 1.96x
git clean -dxf
-------------------
old: 00:00:01(.918)
new: 00:00:00(.295) 6.50x
Signed-off-by: Marius Storm-Olsen <redacted>
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Junio C Hamano <redacted>
Edward Z. Yang [Sun, 31 May 2009 16:15:21 +0000 (18:15 +0200)]
connect.c: Support PuTTY plink and TortoisePlink as SSH on Windows
OpenSSH uses -p to specify custom ports, while PuTTY plink and
TortoisePlink use -P. Git now detects if plink is in GIT_SSH and
modify its flags as necessary.
We call plink with -batch, so that it will error out with an error
message instead of waiting for user input. As reported in msysGit
issue 96, plink wants to interact with the user asking if a host
key should be accepted, but this just blocks the terminal, since
plink tries to get the answer from stdin. However, stdin is
already connected to Git that wants to send input to the remote
command.
But we do not pass -batch to TortoisePlink, because TortoisePlink
uses a GUI to communicate with the user, and it does not understand
-batch.
Signed-off-by: Edward Z. Yang <redacted>
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
Pat Thoyts [Sun, 31 May 2009 16:15:20 +0000 (18:15 +0200)]
git: browsing paths with spaces when using the start command
msysGit issue 258 tracks a problem opening a browser onto file
paths that contain spaces or parentheses when calling the
web--browse script. This patch modifies how the start command is
called to solve this.
Signed-off-by: Pat Thoyts <redacted>
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Mon, 1 Jun 2009 06:41:45 +0000 (08:41 +0200)]
MinGW: fix warning about implicit declaration of _getch()
conio.h provides the declaration.
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Sun, 31 May 2009 16:15:18 +0000 (18:15 +0200)]
test-chmtime: work around Windows limitation
Windows has problems changing the mtime when the file is write protected,
even by the owner of said file.
Add a Windows-only workaround to change the mode if necessary before
trying to change the mtime.
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Mon, 1 Jun 2009 06:04:16 +0000 (08:04 +0200)]
Work around a regression in Windows 7, causing erase_in_line() to crash sometimes
The function FillConsoleOutputCharacterA() was pretty content in XP to take a NULL
pointer if we did not want to store the number of written columns. In Windows 7,
it crashes, but only when called from within Git Bash, not from within cmd.exe.
Go figure.
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Sun, 31 May 2009 16:15:16 +0000 (18:15 +0200)]
Quiet make: do not leave Windows behind
On Windows, we have to check whether there are scripts which would
override .exe files, but this check missed the "quietification".
Make now prints 'BUILTIN all' instead of a long chain of 'test || rm'
commands.
[spr: added clarification what make will print. ]
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Sun, 31 May 2009 16:15:15 +0000 (18:15 +0200)]
MinGW: GCC >= 4 does not need SNPRINTF_SIZE_CORR anymore
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Steffen Prohaska <redacted>
Signed-off-by: Junio C Hamano <redacted>
David Aguilar [Sun, 31 May 2009 08:35:52 +0000 (01:35 -0700)]
diff: generate pretty filenames in prep_temp_blob()
Naturally, prep_temp_blob() did not care about filenames.
As a result, GIT_EXTERNAL_DIFF and textconv generated
filenames such as ".diff_XXXXXX".
This modifies prep_temp_blob() to generate user-friendly
filenames when creating temporary files.
Diffing "name.ext" now generates "XXXXXX_name.ext".
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Junio C Hamano <redacted>
David Aguilar [Sun, 31 May 2009 08:35:51 +0000 (01:35 -0700)]
compat: add a basename() compatibility function
Some systems such as Windows lack libgen.h so provide a
basename() implementation for cross-platform use.
This introduces the NO_LIBGEN_H construct to the Makefile
and autoconf scripts.
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Junio C Hamano <redacted>
David Aguilar [Sun, 31 May 2009 08:35:50 +0000 (01:35 -0700)]
compat: add a mkstemps() compatibility function
mkstemps() is a BSD extension so provide an implementation
for cross-platform use.
Signed-off-by: David Aguilar <redacted>
Tested-by: Johannes Sixt <redacted> (Windows)
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Wed, 27 May 2009 05:14:09 +0000 (07:14 +0200)]
t6050: check pushing something based on a replaced commit
When using something like:
$ git push $there 04a8c^2:master
we need to parse 04a8c to find its second parent and then start
discussing what object to send with the other end. "04a8c^2" is a direct
user input and should mean the same commit as git show "04a8c^2" would
give the user, so it obviously needs to obey the replace rules (making
04a8c parsed), but the object transfer should not look at replace at all.
This patch adds some tests to check that the above is working well.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Mon, 13 Apr 2009 22:36:59 +0000 (00:36 +0200)]
Documentation: add documentation for "git replace"
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
David Aguilar [Tue, 14 Apr 2009 02:01:27 +0000 (19:01 -0700)]
Add git-replace to .gitignore
Signed-off-by: David Aguilar <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Mon, 2 Feb 2009 05:13:06 +0000 (06:13 +0100)]
builtin-replace: use "usage_msg_opt" to give better error messages
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Mon, 2 Feb 2009 05:12:58 +0000 (06:12 +0100)]
parse-options: add new function "usage_msg_opt"
This function can be used instead of "usage_with_options" when you
want to print an error message before the usage string.
It may be useful because:
if (condition)
usage_msg_opt("condition is false", usage, opts);
is shorter than:
if (condition) {
fprintf(stderr, "condition is false\n\n");
usage_with_options(usage, opts);
}
and may be more consistent.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Mon, 2 Feb 2009 05:12:53 +0000 (06:12 +0100)]
builtin-replace: teach "git replace" to actually replace
Teach the syntax: "git replace <object> <replacement>", so that
"git replace" can now create replace refs. These replace refs
will be used by read_sha1_file to substitute <object> with
<replacement> for most of the commands.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Mon, 2 Feb 2009 05:12:44 +0000 (06:12 +0100)]
Add new "git replace" command
This command can only be used now to list replace refs in
"refs/replace/" and to delete them.
The option to list replace refs is "-l".
The option to delete replace refs is "-d".
The behavior should be consistent with how "git tag" and "git branch"
are working.
The code has been copied from "builtin-tag.c" by Kristian Høgsberg
<redacted> and Carlos Rica <redacted> that was itself
based on git-tag.sh and mktag.c by Linus Torvalds.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Fri, 23 Jan 2009 09:07:46 +0000 (10:07 +0100)]
environment: add global variable to disable replacement
This new "read_replace_refs" global variable is set to 1 by
default, so that replace refs are used by default. But
reachability traversal and packing commands ("cmd_fsck",
"cmd_prune", "cmd_pack_objects", "upload_pack",
"cmd_unpack_objects") set it to 0, as they must work with the
original DAG.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Fri, 23 Jan 2009 09:07:26 +0000 (10:07 +0100)]
mktag: call "check_sha1_signature" with the replacement sha1
Otherwise we get a "sha1 mismatch" error for replaced objects.
Note that I am not sure at all that this is a good change.
It may be that we should just refuse to tag a replaced object. But
in this case we should probably give a meaningfull error message
instead of "sha1 mismatch".
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Fri, 23 Jan 2009 09:07:18 +0000 (10:07 +0100)]
replace_object: add a test case
In this patch the setup code is very big, but this will be used in
test cases that will be added later.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Fri, 23 Jan 2009 09:07:10 +0000 (10:07 +0100)]
object: call "check_sha1_signature" with the replacement sha1
Otherwise we get a "sha1 mismatch" error for replaced objects.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Fri, 23 Jan 2009 09:07:01 +0000 (10:07 +0100)]
sha1_file: add a "read_sha1_file_repl" function
This new function will replace "read_sha1_file". This latter function
becoming just a stub to call the former will a NULL "replacement"
argument.
This new function is needed because sometimes we need to use the
replacement sha1.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Fri, 23 Jan 2009 09:06:53 +0000 (10:06 +0100)]
replace_object: add mechanism to replace objects found in "refs/replace/"
The code implementing this mechanism has been copied more-or-less
from the commit graft code.
This mechanism is used in "read_sha1_file". sha1 passed to this
function that match a ref name in "refs/replace/" are replaced by
the sha1 that has been read in the ref.
We "die" if the replacement recursion depth is too high or if we
can't read the replacement object.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Christian Couder [Fri, 23 Jan 2009 09:06:38 +0000 (10:06 +0100)]
refs: add a "for_each_replace_ref" function
This is some preparation work for the following patches that are using
the "refs/replace/" ref namespace.
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sun, 31 May 2009 23:57:42 +0000 (16:57 -0700)]
Merge branch 'sb/opt-filename'
* sb/opt-filename:
parse-opts: add OPT_FILENAME and transition builtins
parse-opts: prepare for OPT_FILENAME
Conflicts:
builtin-log.c
Junio C Hamano [Sun, 31 May 2009 23:18:02 +0000 (16:18 -0700)]
Merge branch 'jc/solaris-0811'
* jc/solaris-0811:
OpenSolaris 200811 (SunOS 5.11) does not want OLD_ICONV
Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6
Junio C Hamano [Sun, 31 May 2009 23:17:58 +0000 (16:17 -0700)]
Merge branch 'sb/show-branch-parse-options'
* sb/show-branch-parse-options:
show-branch: migrate to parse-options API
parse-options: add PARSE_OPT_LITERAL_ARGHELP for complicated argh's
Conflicts:
parse-options.h
Junio C Hamano [Sun, 31 May 2009 23:17:46 +0000 (16:17 -0700)]
Merge branch 'mm/apply-double-slash'
* mm/apply-double-slash:
apply: handle filenames with double slashes better
Junio C Hamano [Sun, 31 May 2009 23:17:31 +0000 (16:17 -0700)]
Merge branch 'sb/format-patch-parseopt'
* sb/format-patch-parseopt:
format-patch: migrate to parse-options API
Conflicts:
builtin-log.c
Junio C Hamano [Sun, 31 May 2009 23:17:11 +0000 (16:17 -0700)]
Merge branch 'jc/mktree'
* jc/mktree:
mktree: validate entry type in input
mktree --batch: build more than one tree object
mktree --missing: updated usage message and man page
mktree --missing: allow missing objects
t1010: add mktree test
mktree: do not barf on a submodule commit
builtin-mktree.c: use a helper function to handle one line of input
mktree: use parse-options
build-in git-mktree
Junio C Hamano [Sun, 31 May 2009 23:17:07 +0000 (16:17 -0700)]
Merge branch 'ew/svn-test-and-old-i18n'
* ew/svn-test-and-old-i18n:
t8005: fix typo, it's ISO-8859-5, not KOI8-R
t8005: convert CP1251 character set to ISO8859-5
t8005: use more portable character encoding names
t5100: use ancient encoding syntax for backwards compatibility
t9301: use ISO8859-1 rather than ISO-8859-1
t3901: Use ISO8859-1 instead of ISO-8859-1 for backward compatibility
t3901: avoid negation on right hand side of '|'
builtin-mailinfo.c: use "ISO8859-1" instead of "latin1" as fallback encoding
builtin-mailinfo.c: compare character encodings case insensitively
Use 'UTF-8' rather than 'utf-8' everywhere for backward compatibility
t3900: use ancient iconv names for backward compatibility
Junio C Hamano [Sun, 31 May 2009 23:16:52 +0000 (16:16 -0700)]
Merge branch 'mw/send-email'
* mw/send-email:
send-email: Remove superfluous `my $editor = ...'
send-email: 'References:' should only reference what is sent
send-email: Handle "GIT:" rather than "GIT: " during --compose
Docs: send-email: --smtp-server-port can take symbolic ports
Docs: send-email: Refer to CONFIGURATION section for sendemail.multiedit
Docs: send-email: Put options back into alphabetical order
Junio C Hamano [Sun, 31 May 2009 23:16:48 +0000 (16:16 -0700)]
Merge branch 'cc/bisect' (early part)
* 'cc/bisect' (early part):
bisect: check ancestors without forking a "git rev-list" process
commit: add function to unparse a commit and its parents
bisect: rework some rev related functions to make them more reusable
Jeff King [Sat, 30 May 2009 21:54:18 +0000 (17:54 -0400)]
git-add: no need for -f when resolving a conflict in already tracked path
When a path F that matches ignore pattern has a conflict, "git add F"
insisted the -f option be given, which did not make sense. It would have
required -f when the path was originally added, but when resolving a
conflict, it already is tracked.
So this should work (and does):
$ echo file >.gitignore
$ echo content >file
$ git add -f file ;# need -f because we are adding new path
$ echo more content >>file
$ git add file ;# don't need -f; it is not actually an "other" file
This is handled under the hood by the COLLECT_IGNORED option to
read_directory. When that code finds an ignored file, it checks the
index to make sure it is not actually a tracked file. However, the test
it uses does not take into account unmerged entries, and considers them
to still be ignored. "git ls-files" uses a more elaborate test and gets
the right answer and the same test should be used here.
Signed-off-by: Junio C Hamano <redacted>
Stephen Boyd [Sun, 31 May 2009 05:08:02 +0000 (22:08 -0700)]
config.txt: document add.ignore-errors
Use the description of "--ignore-errors" from git-add.txt as
inspiration.
Signed-off-by: Stephen Boyd <redacted>
Signed-off-by: Junio C Hamano <redacted>
SZEDER Gábor [Fri, 29 May 2009 12:00:36 +0000 (14:00 +0200)]
bash: remove always true if statement from __git_ps1()
The recent commits
8763dbb1 (completion: fix PS1 display during a
merge on detached HEAD, 2009-05-16),
ff790b6a (completion: simplify
"current branch" in __git_ps1(), 2009-05-10), and
d7107ca6
(completion: fix PS1 display during an AM on detached HEAD,
2009-05-26) ensure that the branch name in __git_ps1() is always set
to something sensible. Therefore, the condition for checking the
non-empty branch name is always fulfilled, and can be removed.
Signed-off-by: SZEDER Gábor <redacted>
Acked-by: Shawn O. Pearce <redacted>
Signed-off-by: Junio C Hamano <redacted>
Björn Steinbrink [Fri, 29 May 2009 10:21:24 +0000 (12:21 +0200)]
git-apply(1): Clarify that one can select where to apply the patch
The patch can be applied to the work tree, the index or both, but the
short description made it look like it's always applied to both.
Signed-off-by: Björn Steinbrink <redacted>
Signed-off-by: Junio C Hamano <redacted>
Clemens Buchacher [Sun, 31 May 2009 10:36:10 +0000 (12:36 +0200)]
http-push: reuse existing is_null_ref
Signed-off-by: Clemens Buchacher <redacted>
Signed-off-by: Junio C Hamano <redacted>
Eric Wong [Sat, 30 May 2009 00:14:47 +0000 (17:14 -0700)]
t9139 uses ancient, backwards-compatible iconv names
This resolves a semantic conflicts early to work with
5ae93df (t3900: use
ancient iconv names for backward compatibility, 2009-05-18).
Signed-off-by: Eric Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Sun, 31 May 2009 05:25:41 +0000 (22:25 -0700)]
Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
git-svn: refuse to dcommit non-UTF-8 messages
Thomas Rast [Thu, 28 May 2009 09:40:15 +0000 (11:40 +0200)]
Documentation: teach stash/pop workflow instead of stash/apply
Recent discussion on the list showed some comments in favour of a
stash/pop workflow:
http://marc.info/?l=git&m=
124234911423358&w=2
http://marc.info/?l=git&m=
124235348327711&w=2
Change the stash documentation and examples to document pop in its own
right (and apply in terms of pop), and use stash/pop in the examples.
Signed-off-by: Thomas Rast <redacted>
Signed-off-by: Junio C Hamano <redacted>
Avery Pennarun [Sat, 30 May 2009 18:24:31 +0000 (14:24 -0400)]
man page: add an EXAMPLES section.
Avery Pennarun [Sat, 30 May 2009 18:05:33 +0000 (14:05 -0400)]
Add basic git-subtree manpage in asciidoc format.
Avery Pennarun [Sat, 30 May 2009 08:11:43 +0000 (04:11 -0400)]
Make --squash work with the 'add' command too.
Avery Pennarun [Sat, 30 May 2009 07:33:39 +0000 (03:33 -0400)]
Fix splitting after using a squash merge.
Avery Pennarun [Sat, 30 May 2009 07:33:17 +0000 (03:33 -0400)]
Don't squash-merge if the old and new commits are the same.
Avery Pennarun [Sat, 30 May 2009 07:18:27 +0000 (03:18 -0400)]
Basic "subtree merge --squash" support.
Instead of merging in the history of the entire subproject, just squash it
all into one commit, but try to at least track which commits we used so that
we can do future merges correctly.
Bonus feature: we can actually switch branches of the subproject this way,
just by "squash merging" back and forth from one tag to another.
Avery Pennarun [Sat, 30 May 2009 05:28:20 +0000 (01:28 -0400)]
merge_msg() is really more like rejoin_msg().
Avery Pennarun [Sat, 30 May 2009 04:48:07 +0000 (00:48 -0400)]
FIXME help for --squash option
Avery Pennarun [Sat, 30 May 2009 05:10:14 +0000 (01:10 -0400)]
slightly rearrange help message for split.
Avery Pennarun [Sat, 30 May 2009 05:05:43 +0000 (01:05 -0400)]
New --branch option to split command.
This is just a handy way to create a new branch from the newly-split subtree.
Avery Pennarun [Sat, 30 May 2009 04:47:59 +0000 (00:47 -0400)]
typo in comment
Junio C Hamano [Fri, 29 May 2009 22:01:16 +0000 (15:01 -0700)]
Merge branch 'sb/maint-1.6.2-opt-filename-fix'
* sb/maint-1.6.2-opt-filename-fix:
apply, fmt-merge-msg: use relative filenames
commit: -F overrides -t
Junio C Hamano [Fri, 29 May 2009 22:00:15 +0000 (15:00 -0700)]
Merge branch 'jc/maint-add-p-coalesce-fix'
* jc/maint-add-p-coalesce-fix:
t3701: ensure correctly set up repository after skipped tests
Revert "git-add--interactive: remove hunk coalescing"
Splitting a hunk that adds a line at the top fails in "add -p"
Junio C Hamano [Fri, 29 May 2009 21:59:50 +0000 (14:59 -0700)]
Merge branch 'rs/maint-grep-word-regexp-fix'
* rs/maint-grep-word-regexp-fix:
grep: fix word-regexp at the beginning of lines