Johannes Schindelin [Fri, 11 Jun 2010 22:45:35 +0000 (00:45 +0200)]
merge-octopus: Work around environment issue on Windows
For some reason, the environment variables get upper-cased when a
subprocess is launched on Windows. Cope with that.
[PT: fixed typo in the char range noted by junio]
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Pat Thoyts <redacted>
Pat Thoyts [Thu, 18 Mar 2010 21:45:19 +0000 (21:45 +0000)]
MinGW: Report errors when failing to launch the html browser.
The mingw function to launch the system html browser is silent if the
target file does not exist leaving the user confused. Make it display
something.
Signed-off-by: Pat Thoyts <redacted>
Reviewed-by: Erik Faye-Lund <redacted>
Pat Thoyts [Wed, 17 Mar 2010 15:17:34 +0000 (15:17 +0000)]
MinGW: fix stat() and lstat() implementations for handling symlinks
In msysGit the stat() function has been implemented using mingw_lstat
which sets the st_mode member to S_IFLNK when a symbolic links is found.
This causes the is_executable function to return when git attempts to
build a list of available commands in the help code and we end up missing
most git commands. (msysGit issue #445)
This patch modifies the implementation so that lstat() will return the link
flag but if we are called as stat() we read the size of the target and set
the mode to that of a regular file.
Includes squashed fix st_mode for symlink dirs
Signed-off-by: Pat Thoyts <redacted>
Signed-off-by: Erik Faye-Lund <redacted>
Sebastian Schuberth [Mon, 28 Dec 2009 17:13:52 +0000 (18:13 +0100)]
MinGW: Add missing file mode bit defines
Signed-off-by: Sebastian Schuberth <redacted>
Sebastian Schuberth [Mon, 28 Dec 2009 17:04:21 +0000 (18:04 +0100)]
MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility
Signed-off-by: Sebastian Schuberth <redacted>
Junio C Hamano [Thu, 30 Sep 2010 21:59:53 +0000 (14:59 -0700)]
Merge branch 'maint'
* maint:
Fix typo in pack-objects' usage
Make sure that git_getpass() never returns NULL
t0004 (unwritable files): simplify error handling
rev-list-options: clarify --parents and --children
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 19:03:31 +0000 (19:03 +0000)]
send-email: extract_valid_address use qr// regexes
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:43:05 +0000 (13:43 +0000)]
send-email: is_rfc2047_quoted use qr// regexes
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Wed, 29 Sep 2010 22:22:33 +0000 (23:22 +0100)]
Fix typo in pack-objects' usage
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Pat Thoyts <redacted>
Signed-off-by: Junio C Hamano <redacted>
Johannes Schindelin [Wed, 29 Sep 2010 22:22:32 +0000 (23:22 +0100)]
Make sure that git_getpass() never returns NULL
The result of git_getpass() is used without checking for NULL, so let's
just die() instead of returning NULL.
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Pat Thoyts <redacted>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:43:09 +0000 (13:43 +0000)]
send-email: use Perl idioms in while loop
Change `while(<$fh>) { my $c = $_' to `while(my $c = <$fh>) {', and
use `chomp $c' instead of `$c =~ s/\n$//g;', the two are equivalent in
this case.
I've also changed the --cccmd test so that we test for the stripping
of whitespace at the beginning of the lines returned from the
--cccmd. I think we probably shouldn't do this, but it was there
already so I haven't changed the behavior.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:43:08 +0000 (13:43 +0000)]
send-email: make_message_id use "require" instead of "use"
Change the use of Sys::Hostname from a "use" to a "require". The
former happens in an implicit BEGIN block and is thus immune from the
if block it's contained in, so it's always loaded.
This should speed up the invocation of git-send-email by a few
milliseconds.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:43:07 +0000 (13:43 +0000)]
send-email: send_message die on $!, not $?
If close fails we want to emit errno, not the return code of whatever
happened to be the child process run.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:43:04 +0000 (13:43 +0000)]
send-email: use (?:) instead of () if no match variables are needed
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:43:03 +0000 (13:43 +0000)]
send-email: sanitize_address use qq["foo"], not "\"foo\""
Perl provides an alternate quote syntax which can make using "" inside
interpolated strings easier to read.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:43:02 +0000 (13:43 +0000)]
send-email: sanitize_address use $foo, not "$foo"
There's no reason to explicitly stringify a variable in Perl unless
it's an overloaded object and you want to call overload::StrVal,
otherwise it's just creating a new scalar redundantly.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:43:01 +0000 (13:43 +0000)]
send-email: use \E***\Q instead of \*\*\*
Change the regex introduced in
a03bc5b to use the \E...\Q escape
syntax instead of using backslashes. It's more readable like this, and
easier to grep for.
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:43:00 +0000 (13:43 +0000)]
send-email: cleanup_compose_files doesn't need a prototype
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:42:59 +0000 (13:42 +0000)]
send-email: unique_email_list doesn't need a prototype
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:42:58 +0000 (13:42 +0000)]
send-email: file_declares_8bit_cte doesn't need a prototype
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:42:57 +0000 (13:42 +0000)]
send-email: get_patch_subject doesn't need a prototype
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:42:56 +0000 (13:42 +0000)]
send-email: use lexical filehandles during sending
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:42:55 +0000 (13:42 +0000)]
send-email: use lexical filehandles for $compose
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Ævar Arnfjörð Bjarmason [Thu, 30 Sep 2010 13:42:54 +0000 (13:42 +0000)]
send-email: use lexical filehandle for opendir
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Reviewed-by: Jeff King <redacted>
>
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Sun, 26 Sep 2010 13:02:24 +0000 (15:02 +0200)]
gitweb/Makefile: Include gitweb/config.mak
Allow for gitweb-specific Makefile config to reside in config.mak file
in the 'gitweb/' subdirectory. This means that gitweb-specific
build-time configuration variable can reside in gitweb-specific
gitweb/config.mak
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Sun, 26 Sep 2010 13:02:26 +0000 (15:02 +0200)]
gitweb/Makefile: Add 'test' and 'test-installed' targets
The 'test-installed' target in gitweb/Makefile tests installed gitweb,
using the same destination directory that 'install' target uses.
The 'test' target is just a convenience wrapper invoking 'gitweb-test'
target of t/Makefile.
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Sun, 26 Sep 2010 13:02:25 +0000 (15:02 +0200)]
t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED
You can set the GITWEB_TEST_INSTALLED environment variable to the
gitwebdir (the directory where gitweb is installed / deployed to) of
an existing gitweb instalation, or to the pathname of installed gitweb
script, to test that installation.
This change is intended to make it possible to test that process of
installing gitweb and the modules it depends on works correctly (after
splitting gitweb).
If GITWEB_TEST_INSTALLED is used, print what script are we testing
to make it easy to spot that we test installed gitweb.
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jakub Narebski [Sun, 26 Sep 2010 11:34:56 +0000 (13:34 +0200)]
gitweb: Move call to evaluate_git_version after evaluate_gitweb_config
Now evaluate_git_version() is inside run_request() to be called for each
request, instead of once per starting gitweb; this currently matters only
when using FastCGI interface (gitweb.fcgi).
This change was done because evaluate_git_version() uses $GIT variable,
which can be set / modified by gitweb config file, but the variable is
modified this way by gitweb config file used in gitweb tests. Without
this change there is spurious extra output from t9500 test when tests are
run with '--debug' option.
Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
René Scharfe [Sun, 26 Sep 2010 16:26:56 +0000 (18:26 +0200)]
diff: avoid repeated scanning while looking for funcname
For each hunk, xdl_find_func searches the preimage for a function name
until the beginning of the file. If the file does not contain any
function names, this search has complexity O(n^2) in the number of
hunks n.
Instead, inline xdl_find_func() and keep track of up to which line we
have scanned already and the contents of the last funcname line that
we have found.
Noticed and a different approach proposed by Clemens Buchacher.
This alternative solution was done by René Scharfe.
Signed-off-by: Junio C Hamano <redacted>
Jonathan Nieder [Tue, 7 Sep 2010 01:50:17 +0000 (20:50 -0500)]
t0004 (unwritable files): simplify error handling
Instead of
... normal test script ...
status=$?
... cleanup ...
(exit $status)
set up cleanup commands with test_when_finished. This makes the
test script a little shorter, and more importantly, it ensures errors
during cleanup are reported.
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael J Gruber [Thu, 30 Sep 2010 15:31:43 +0000 (17:31 +0200)]
rev-list-options: clarify --parents and --children
Make it clearer that --parents resp. --children list the parent resp.
child commits next to each commit, so that I understand next time.
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:10 +0000 (02:29 -0600)]
merge-recursive: Remove redundant path clearing for D/F conflicts
The code had several places where individual checks were done to remove
files that could be in the way of directories in D/F conflicts. Not all
D/F conflicts could have a path cleared for them in such a manner, however,
leading to the need to create make_room_for_directories_of_df_conflicts()
as done in the previous patch. That new function could not have been
incorporated into the code sooner, since not all relevant code paths had
been deferred to process_df_entry() yet, leading to the creation of even
more of these now-redundant path removals.
Clean out all of these extra D/F path clearing cases.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:09 +0000 (02:29 -0600)]
merge-recursive: Make room for directories in D/F conflicts
When there are unmerged entries present, make sure to check for D/F
conflicts first and remove any files present in HEAD that would be in the
way of creating files below the correspondingly named directory. Such
files will be processed again at the end of the merge in
process_df_entry(); at that time we will be able to tell if we need to
and can reinstate the file, whether we need to place its contents in a
different file due to the directory still being present, etc.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:08 +0000 (02:29 -0600)]
handle_delete_modify(): Check whether D/F conflicts are still present
If all the paths below some directory involved in a D/F conflict were not
removed during the rest of the merge, then the contents of the file whose
path conflicted needs to be recorded in file with an alternative filename.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:07 +0000 (02:29 -0600)]
merge_content(): Check whether D/F conflicts are still present
If all the paths below some directory involved in a D/F conflict were not
removed during the rest of the merge, then the contents of the file whose
path conflicted needs to be recorded in file with an alternative filename.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:06 +0000 (02:29 -0600)]
conflict_rename_rename_1to2(): Fix checks for presence of D/F conflicts
This function is called from process_df_entry(), near the end of the merge.
Rather than just checking whether one of the sides of the merge had a
directory at the same path as one of our files, check whether that
directory is still present by this point of our merge.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:05 +0000 (02:29 -0600)]
conflict_rename_delete(): Check whether D/F conflicts are still present
If all the paths below some directory involved in a D/F conflict were not
removed during the rest of the merge, then the contents of the file whose
path conflicted needs to be recorded in file with an alternative filename.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:04 +0000 (02:29 -0600)]
merge-recursive: Delay modify/delete conflicts if D/F conflict present
When handling merges with modify/delete conflicts, if the modified path is
involved in a D/F conflict, handle the issue in process_df_entry() rather
than process_entry().
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:03 +0000 (02:29 -0600)]
merge-recursive: Delay content merging for renames
Move the handling of content merging for renames from process_renames() to
process_df_entry().
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:02 +0000 (02:29 -0600)]
merge-recursive: Delay handling of rename/delete conflicts
Move the handling of rename/delete conflicts from process_renames() to
process_df_entry().
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:01 +0000 (02:29 -0600)]
merge-recursive: Move handling of double rename of one file to other file
Move the handling of rename/rename conflicts where one file is renamed on
both sides to the same file, from process_renames() to process_entry().
Here we avoid the three way merge logic by just using
update_stages_and_entry() to move the higher stage entries in the index
from the rename source to the rename destination, and then allow
process_entry() to do its magic.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:29:00 +0000 (02:29 -0600)]
merge-recursive: Move handling of double rename of one file to two
Move the handling of rename/rename conflicts where one file is renamed to
two different files, from process_renames() to process_df_entry().
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:59 +0000 (02:28 -0600)]
merge-recursive: Avoid doubly merging rename/add conflict contents
When a commit moves A to B while another commit created B (or moved C to
B), and these two different commits serve as different merge-bases for a
later merge,
c94736a (merge-recursive: don't segfault while handling
rename clashes 2009-07-30) added some special code to avoid segfaults.
Since that commit, the two versions of B are merged in place (which could
be potentially conflicting) and the intermediate result is used as the
virtual ancestor.
However, right before this special merge, try_merge was turned on, meaning
that process_renames() would try an alternative merge that ignores the
'add' part of the conflict, and, if the merge is clean, store that as the
new virtual ancestor. This could cause incorrect merging of criss-cross
merges; it would typically result in just recording a slightly confusing
merge base, but in some cases it could cause silent acceptance of one side
of a merge as the final resolution when a conflict should have been
flagged.
When we do a special merge for such a rename/add conflict between
merge-bases, turn try_merge off to avoid an inappropriate second merge.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:58 +0000 (02:28 -0600)]
merge-recursive: Update merge_content() call signature
Enable calling merge_content() and providing more information about renames
and D/F conflicts (which we will want to do from process_df_entry()).
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:57 +0000 (02:28 -0600)]
merge-recursive: Update conflict_rename_rename_1to2() call signature
To facilitate having this function called later using information stored
in a rename_df_conflict_info struct, accept a diff_filepair instead of a
rename.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:56 +0000 (02:28 -0600)]
merge-recursive: Structure process_df_entry() to handle more cases
Modify process_df_entry() (mostly just indentation level changes) to
get it ready for handling more D/F conflict type cases.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:55 +0000 (02:28 -0600)]
merge-recursive: Have process_entry() skip D/F or rename entries
If an entry has an associated rename_df_conflict_info, skip it and allow
it to be processed by process_df_entry().
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:54 +0000 (02:28 -0600)]
merge-recursive: New function to assist resolving renames in-core only
process_renames() and process_entry() have nearly identical code for
doing three-way file merging to resolve content changes. Since we are
already deferring some of the current rename handling in order to better
handle D/F conflicts, it seems to make sense to defer content merging as
well and remove the (nearly) duplicated code sections for handling this
merging.
To facilitate this process, add a new update_stages_and_entry() function
which will map the higher stage index entries from two files involved in a
rename into the resulting rename destination's index entries, and update
the associated stage_data structure.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:53 +0000 (02:28 -0600)]
merge-recursive: New data structures for deferring of D/F conflicts
Since we need to resolve paths (including renames) in-core first and defer
checking of D/F conflicts (namely waiting to see if directories are still
in the way after all paths are resolved) before updating files involved in
D/F conflicts, we will need to first process_renames, then record some
information about the rename needed at D/F resolution time, and then make
use of that information when resolving D/F conflicts at the end.
This commit adds some relevant data structures for storing the necessary
information.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:52 +0000 (02:28 -0600)]
merge-recursive: Move process_entry's content merging into a function
This move is in preparation for merge_content growing and being called from
multiple places in order to handle D/F conflicts.
I also snuck in a small change to the output in the case that the merged
content for the file matches the current file contents, to make it better
match (and thus more able to take over) how other merge_file() calls in
process_renames() are handled.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:51 +0000 (02:28 -0600)]
merge-recursive: Move delete/modify handling into dedicated function
This move is in preparation for the function being called from multiple
places in order to handle D/F conflicts.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:50 +0000 (02:28 -0600)]
merge-recursive: Move rename/delete handling into dedicated function
This move is in preparation for the function growing and being called from
multiple places in order to handle D/F conflicts.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:49 +0000 (02:28 -0600)]
merge-recursive: Nuke rename/directory conflict detection
Since we want to resolve merges in-core and then detect at the end whether
D/F conflicts remain in the way, we should just apply renames in-core and
let logic elsewhere check for D/F conflicts.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:48 +0000 (02:28 -0600)]
merge-recursive: Rename conflict_rename_rename*() for clarity
The names conflict_rename_rename and conflict_rename_rename_2 did not make
it clear what they were handling. Since the first of these handles one
file being renamed in both branches to different files, while the latter
handles two different files being renamed to the same thing, add a little
'1to2' and '2to1' suffix on these and an explanatory comment to make their
intent clearer.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:47 +0000 (02:28 -0600)]
merge-recursive: Small code clarification -- variable name and comments
process_renames() had a variable named "stage" and derived variables
src_other and dst_other whose purpose was not immediately obvious; also,
I want to extend the scope of this variable and use it later, so it should
have a more descriptive name. Do so, and add a brief comment explaining
how it is used and what it relates to.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:46 +0000 (02:28 -0600)]
t6036: Add testcase for undetected conflict
If merging two lines of development involves a rename/add conflict, and two
different people make such a merge but resolve it differently, and then
someone tries to merge the resulting two merges, then they should clearly
get a conflict due to the different resolutions from the previous
developers. However, in some such cases the conflict would not be detected
and git would silently accept one of the two versions being merged as the
final merge resolution.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:45 +0000 (02:28 -0600)]
t6036: Add a second testcase similar to the first but with content changes
c94736a (merge-recursive: don't segfault while handling rename clashes
2009-07-30) added t6036 with a testcase that involved dual renames and a
criss-cross merge. Add a test that is nearly identical, but which also
involves content modification -- a case git currently does not merge
correctly.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:44 +0000 (02:28 -0600)]
t6036: Test index and worktree state, not just that merge fails
c94736a (merge-recursive: don't segfault while handling rename clashes
2009-07-30) added this testcase with an interesting corner case test,
which previously had cased git to segfault. This test ensures that the
segfault does not return and that the merge correctly fails; just add
some checks that verify the state of the index and worktree after the merge
are correct.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:43 +0000 (02:28 -0600)]
t6020: Add a testcase for modify/delete + directory/file conflict
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:42 +0000 (02:28 -0600)]
t6020: Modernize style a bit
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:41 +0000 (02:28 -0600)]
t6022: Add tests for rename/rename combined with D/F conflicts
Add tests where one file is renamed to two different paths in different
sides of history, and where each of the new files matches the name of a
directory from the opposite side of history. Include tests for both the
case where the merge results in those directories not being cleanly
removed, and where those directories are cleanly removed during the merge.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:40 +0000 (02:28 -0600)]
t6022: Add paired rename+D/F conflict: (two/file, one/file) -> (one, two)
An interesting testcase is having two files each in their own subdirectory
getting renamed to the toplevel at the directory pathname of the other.
Questions arise as to whether the order of operations matters and whether
the directories can correctly get out of the way and make room for the
new files.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:39 +0000 (02:28 -0600)]
t6022: Add tests with both rename source & dest involved in D/F conflicts
Having the source of a rename be involved in a directory/file conflict does
not currently pose any difficulties to the current merge-recursive
algorithm (in contrast to destinations of renames and D/F conflicts).
However, combining the two seemed like good testcases to include for
completeness.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:38 +0000 (02:28 -0600)]
t6022: Add tests for reversing order of merges when D/F conflicts present
When merging two branches with some path involved in a D/F conflict, the
choice of which branch to merge into the other matters for (at least) two
reasons: (1) whether the working copy has a directory full of files that
is in the way of a file, or a file exists that is in the way of a
directory of files, (2) when the directory full of files does not disappear
due to the merge, what files at the same paths should be renamed to
(e.g. filename~HEAD vs. filename~otherbranch).
Add some tests that reverse the merge order of two other tests, and which
verify the contents are as expected (namely, that the results are identical
other than modified-for-uniqueness filenames involving branch names).
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:37 +0000 (02:28 -0600)]
t6022: Add test combinations of {content conflict?, D/F conflict remains?}
Add testing of the various ways that a renamed file to a path involved in
a directory/file conflict may be involved in. This includes whether or not
there are conflicts of the contents of the renamed file (if the file was
modified on both sides of history), and whether the directory from the
other side of the merge will disappear as a result of the merge or not.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Elijah Newren [Mon, 20 Sep 2010 08:28:36 +0000 (02:28 -0600)]
t6032: Add a test checking for excessive output from merge
Previous D/F fixes I submitted (
5a2580d and
ae74548) had caused merge to
become excessively spammy, which was fixed in
96ecac6 (merge-recursive:
Avoid excessive output for and reprocessing of renames 2010-08-20). Add a
new test to avoid repeating that mistake with my several upcoming changes.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Mon, 20 Sep 2010 08:28:35 +0000 (02:28 -0600)]
merge-recursive: Restructure showing how to chain more process_* functions
In
3734893 (merge-recursive: Fix D/F conflicts 2010-07-09),
process_df_entry() was added to process_renames() and process_entry() but
in a somewhat restrictive manner. Modify the code slightly to make it
clearer how we could chain more such functions if necessary, and alter
process_df_entry() to handle such chaining.
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Schalk, Ken [Mon, 20 Sep 2010 08:28:34 +0000 (02:28 -0600)]
t3030: Add a testcase for resolvable rename/add conflict with symlinks
d5af510 (RE: [PATCH] Avoid rename/add conflict when contents are identical
2010-09-01) avoided erroring out in a rename/add conflict when the contents
were identical. A simpler fix could have handled that particular testcase,
but it would not correctly handle the case where a symlink is involved.
Add another testcase using symlinks, to avoid breaking that case.
Signed-off-by: Ken Schalk <redacted>
Signed-off-by: Elijah Newren <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Thu, 30 Sep 2010 00:25:28 +0000 (17:25 -0700)]
Merge branch 'en/rename-d-f' into en/merge-recursive
* en/rename-d-f:
merge-recursive: D/F conflicts where was_a_dir/file -> was_a_dir
t3509: Add rename + D/F conflict testcase that recursive strategy fails
Kirill Smelkov [Wed, 29 Sep 2010 11:35:24 +0000 (15:35 +0400)]
blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''
We need to get the correct mode when blame reads the source from the
working tree, the index, or trees. This allows us to omit running
textconv filters on symbolic links.
Signed-off-by: Kirill Smelkov <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Kirill Smelkov [Wed, 29 Sep 2010 11:35:23 +0000 (15:35 +0400)]
blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinks
git blame --textconv is wrongly calling the textconv filter on
symlinks: symlinks are stored as blobs whose content is the target of
the link, and blame calls the textconv filter on a temporary file
filled-in with the content of this blob.
For example:
$ git blame -C -C regular-file.pdf
Error: May not be a PDF file (continuing anyway)
Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table
Warning: program returned non-zero exit code #1
fatal: unable to read files to diff
That errors come from pdftotext run on symlink.pdf being extracted to
/tmp/ with one-line plain-text content pointing to link destination.
So several failures are demonstrated here:
- git cat-file --textconv :symlink.bin # also HEAD:symlink.bin
- git blame --textconv symlink.bin
- git blame -C -C --textconv regular-file # but also looks on symlink.bin
At present they all fail with something like.
E: /tmp/j3ELEs_symlink.bin is not "binary" file
NOTE: git diff doesn't try to textconv the pathnames, it runs the
textual diff without textconv, which is the expected behavior.
Signed-off-by: Kirill Smelkov <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Kirill Smelkov [Wed, 29 Sep 2010 11:35:22 +0000 (15:35 +0400)]
blame,cat-file: Prepare --textconv tests for correctly-failing conversion program
The textconv filter is sometimes incorrectly ran on a temporary file
whose content is the target of a symbolic link, instead of actual file
content. Prepare to test this by marking the content of the file to
convert with "bin:", and let the helper die if "bin:" is not found in
the file content.
NOTE: I've changed $@ to $1 in helper becase textconv program "should
take a single argument" (see Documentation/gitattributes.txt), so
making this more explicit makes sense and also helps to avoid
problems with feeding arguments to echo.
Signed-off-by: Kirill Smelkov <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 29 Sep 2010 21:07:59 +0000 (14:07 -0700)]
Start 1.7.4 cycle
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 29 Sep 2010 22:26:12 +0000 (15:26 -0700)]
Merge branch 'tr/send-email-refuse-sending-unedited-cover-letter'
* tr/send-email-refuse-sending-unedited-cover-letter:
send-email: Refuse to send cover-letter template subject
Junio C Hamano [Wed, 29 Sep 2010 20:50:02 +0000 (13:50 -0700)]
Merge branch 'ab/send-email-catfile'
* ab/send-email-catfile:
send-email: use catfile() to concatenate files
Junio C Hamano [Wed, 29 Sep 2010 20:49:57 +0000 (13:49 -0700)]
Merge branch 'jc/grep-header-all-match-fix'
* jc/grep-header-all-match-fix:
log --author: take union of multiple "author" requests
grep: move logic to compile header pattern into a separate helper
Junio C Hamano [Wed, 29 Sep 2010 20:49:38 +0000 (13:49 -0700)]
Merge branch 'jc/no-branch-name-with-dash-at-front'
* jc/no-branch-name-with-dash-at-front:
disallow branch names that start with a hyphen
Junio C Hamano [Wed, 29 Sep 2010 20:49:28 +0000 (13:49 -0700)]
Merge branch 'jn/gitweb-test-lib'
* jn/gitweb-test-lib:
t/gitweb-lib.sh: Use tabs for indent consistently
t/gitweb-lib.sh: Use GIT_BUILD_DIR
Junio C Hamano [Wed, 29 Sep 2010 20:49:23 +0000 (13:49 -0700)]
Merge branch 'bc/fortran-userdiff'
* bc/fortran-userdiff:
userdiff.c: add builtin fortran regex patterns
Junio C Hamano [Wed, 29 Sep 2010 20:49:18 +0000 (13:49 -0700)]
Merge branch 'jk/read-tree-empty'
* jk/read-tree-empty:
read-tree: deprecate syntax without tree-ish args
Junio C Hamano [Wed, 29 Sep 2010 20:49:09 +0000 (13:49 -0700)]
Merge branch 'rr/format-patch-count-without-merges'
* rr/format-patch-count-without-merges:
format-patch: Don't go over merge commits
t4014-format-patch: Call test_tick before committing
Junio C Hamano [Wed, 29 Sep 2010 20:49:03 +0000 (13:49 -0700)]
Merge branch 'jc/pickaxe-grep'
* jc/pickaxe-grep:
diff/log -G<pattern>: tests
git log/diff: add -G<regexp> that greps in the patch text
diff: pass the entire diff-options to diffcore_pickaxe()
gitdiffcore doc: update pickaxe description
Junio C Hamano [Wed, 29 Sep 2010 20:48:44 +0000 (13:48 -0700)]
Merge branch 'gb/shell-ext'
* gb/shell-ext:
shell: Display errors from improperly-formatted command lines
shell: Rewrite documentation and improve error message
Add sample commands for git-shell
Add interactive mode to git-shell for user-friendliness
Allow creation of arbitrary git-shell commands
Junio C Hamano [Wed, 29 Sep 2010 20:48:20 +0000 (13:48 -0700)]
Merge branch 'rr/fmt-merge-msg'
* rr/fmt-merge-msg:
t6200-fmt-merge-msg: Exercise '--log' to configure shortlog length
t6200-fmt-merge-msg: Exercise 'merge.log' to configure shortlog length
merge: Make 'merge.log' an integer or boolean option
merge: Make '--log' an integer option for number of shortlog entries
fmt_merge_msg: Change fmt_merge_msg API to accept shortlog_len
Conflicts:
builtin/merge.c
Junio C Hamano [Wed, 29 Sep 2010 20:47:51 +0000 (13:47 -0700)]
Merge branch 'po/etc-gitattributes'
* po/etc-gitattributes:
Add global and system-wide gitattributes
Conflicts:
Documentation/config.txt
Makefile
Junio C Hamano [Tue, 28 Sep 2010 21:08:38 +0000 (16:08 -0500)]
MinGW: avoid collisions between "tags" and "TAGS"
On case insensitive filesystems, "tags" and "TAGS" target will try to
overwrite the same file. Allow MinGW to use "ETAGS" instead.
These two targets do produce real files; do not put them on .PHONY target
list.
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
Matthieu Moy [Wed, 29 Sep 2010 07:26:23 +0000 (09:26 +0200)]
diff: trivial fix for --output file error message
The option argument is either after the equal sign in --output=... or in
the next command-line argument. optarg is the reliable way to access it.
Signed-off-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Stephen Boyd [Wed, 29 Sep 2010 07:26:44 +0000 (00:26 -0700)]
send-email: Use To: headers in patch files
It's a minor annoyance when you take the painstaking time to setup To:
headers for each patch in a large series, and then go out to send the
series with git-send-email and watch git ignore the To: headers in the
patch files.
Therefore, always add To: headers from a patch file to the To: headers
for that message. Keep the prompt for the blanket To: header so as to
not break scripts (and user expectations). This means even if a patch
has a To: header, git will prompt for the To: address. Otherwise, we'll
need to introduce interface breakage to either request the header for
each patch missing a To: header or default the header to whatever To:
address is found first (be it in a patch or from user input). Both of
these options don't seem very obvious/useful.
Reported-by: Viresh Kumar <redacted>
Signed-off-by: Stephen Boyd <redacted>
Tested-by: Viresh Kumar <redacted>
Signed-off-by: Junio C Hamano <redacted>
Michael J Gruber [Tue, 28 Sep 2010 11:16:07 +0000 (13:16 +0200)]
user-manual: fix anchor name Finding-comments-With-given-Content
Change the anchor name to
Finding-commits-With-given-Content
so that it corresponds to the actual content there.
Signed-off-by: Michael J Gruber <redacted>
Signed-off-by: Junio C Hamano <redacted>
Kirill Smelkov [Tue, 28 Sep 2010 08:20:24 +0000 (12:20 +0400)]
user-manual: be consistent in illustrations to 'git rebase'
Since we use a-b-c for mywork commits in one place, I think it would be
logical to also use a-b-c too in other illustration on this topic.
Signed-off-by: Kirill Smelkov <redacted>
Signed-off-by: Junio C Hamano <redacted>
Jon Seymour [Mon, 27 Sep 2010 15:32:45 +0000 (01:32 +1000)]
stash: simplify parsing fixes
This patch simplifies Brian's fix for the recent regression by:
* eliminating the extra loop
* eliminating use of git rev-parse for parsing flags
* making use of the for opt idiom for the retained loop
* eliminating the redundant -- case
The patch has been tested with the tests in current maint.
Signed-off-by: Jon Seymour <redacted>
Signed-off-by: Junio C Hamano <redacted>
Kevin Ballard [Mon, 27 Sep 2010 23:58:26 +0000 (16:58 -0700)]
diff: add synonyms for -M, -C, -B
Add new long-form options --detect-renames[=<n>], --detect-copies[=<n>],
and --break-rewrites[=[<n>][/<m>]] as synonyms for the -M, -C, and -B
options (respectively).
Signed-off-by: Kevin Ballard <redacted>
Signed-off-by: Junio C Hamano <redacted>
Kevin Ballard [Mon, 27 Sep 2010 23:58:25 +0000 (16:58 -0700)]
merge-recursive: option to specify rename threshold
The recursive merge strategy turns on rename detection but leaves the
rename threshold at the default. Add a strategy option to allow the user
to specify a rename threshold to use.
Signed-off-by: Kevin Ballard <redacted>
Signed-off-by: Junio C Hamano <redacted>
Dan McGee [Mon, 27 Sep 2010 15:19:09 +0000 (10:19 -0500)]
mergetool-lib: make the three-way diff the default for vim/gvim
The original vimdiff/gvimdiff configuration is now available by using
'vimdiff2' or 'gvimdiff2' as the preferred merge tool.
Signed-off-by: Dan McGee <redacted>
Signed-off-by: Junio C Hamano <redacted>
Junio C Hamano [Wed, 29 Sep 2010 16:42:53 +0000 (09:42 -0700)]
Git 1.7.3.1
Signed-off-by: Junio C Hamano <redacted>
Jon Seymour [Tue, 28 Sep 2010 13:19:52 +0000 (23:19 +1000)]
stash: fix git stash branch regression when branch creation fails
"git stash branch <branch> <stash>" started discarding the stash
when the branch creation fails. It should have kept the stash
intact when aborting.
Signed-off-by: Jon Seymour <redacted>
Signed-off-by: Junio C Hamano <redacted>
Tomas Carnecky [Tue, 28 Sep 2010 13:19:51 +0000 (23:19 +1000)]
stash drops the stash even if creating the branch fails because it already exists
This bug was disovered by someone on IRC when he tried to
$ git stash branch <branch> <stash>
while <branch> already existed. In that case the stash is dropped even
though it isn't applied on any branch, so the stash is effectively lost.
Signed-off-by: Tomas Carnecky <redacted>
Signed-off-by: Junio C Hamano <redacted>
Alexander Sulfrian [Mon, 30 Aug 2010 11:30:51 +0000 (13:30 +0200)]
daemon: allow more than one host address given via --listen
When the host has more than one interfaces, daemon can listen to all
of them by not giving any --listen option, or listen to only one.
Teach it to accept more than one --listen options.
Remove the hostname information form the die, if no socket could be
created. It would only trigger when no interface out of either all
interface or the ones specified on the command line with --listen
options, can be listened to and so the user does know which "host" was
asked.
Signed-off-by: Alexander Sulfrian <redacted>
Signed-off-by: Junio C Hamano <redacted>
Alexander Sulfrian [Mon, 30 Aug 2010 11:30:50 +0000 (13:30 +0200)]
daemon: add helper function named_sock_setup
Add named_sock_setup as helper function for socksetup to make it
easier to create more than one listen sockets. named_sock_setup could
be called more than one time and add the new sockets to the supplied
socklist_p.
Signed-off-by: Alexander Sulfrian <redacted>
Signed-off-by: Junio C Hamano <redacted>
Linus Torvalds [Mon, 27 Sep 2010 19:14:57 +0000 (12:14 -0700)]
Fix missing 'does' in man-page for 'git checkout'
Reported-by: Rainer Standke <redacted>
Signed-off-by: Linus Torvalds <redacted>
Signed-off-by: Junio C Hamano <redacted>