Also adds test cases for adding removing and deleting
binary and text files plus two tests for the checks on
binary files.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
If git-write-index is called without --missing-ok, it reports invalid
objects that it finds in the index. But without this patch it dies
right away or may run into an infinite loop.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
When test_expect_failure detects that a command failed, it still has to
treat a program that crashed from a signal as unexpected failure.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <junkio@cox.net>
When path-list-insert is called on an existing path, it returned an
unrelated element in the list. Luckily most of the callers are
ignoring the return value, but merge-recursive uses it at three places
and this would have resulted in a bogus rename detection.
Signed-off-by: Junio C Hamano <junkio@cox.net>
The graft file can contain comment lines and read_graft_line can
return NULL for such an input, which should be skipped by the
reader.
Signed-off-by: Junio C Hamano <junkio@cox.net>
* maint:
git-rebase: Use --ignore-if-in-upstream option when executing git-format-patch.
git-svn: fix dcommit losing changes when out-of-date from svn
git-svn: don't die on rebuild when --upgrade is specified
git-svn: avoid printing filenames of files we're not tracking
This reduces the number of conflicts when rebasing after a series of
patches to the same piece of code is committed upstream.
Signed-off-by: Robert Shearman <rob@codeweavers.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This moves the example to specify a line range with regexps to
a later part of the manual page that has similar examples.
Signed-off-by: Junio C Hamano <junkio@cox.net>
There was a bug in dcommit (and commit-diff) which caused deltas
to be generated against the latest version of the changed file
in a repository, and not the revision we are diffing (the tree)
against locally.
This bug can cause recent changes to the svn repository to be
silently clobbered by git-svn if our repository is out-of-date.
Thanks to Steven Grimm for noticing the bug.
The (few) people using the commit-diff command are now required
to use the -r/--revision argument. dcommit usage is unchanged.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
--copy-remote and --upgrade are rarely (never?) used together,
so if --copy-remote is specified, that means the user really
wanted to copy the remote ref, and we should fail if that fails.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This is purely an aesthetic change, we already skip importing of
files that don't affect the subdirectory we import.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Currently the error e.g. when pushing to a read-only repository is quite
confusing, this attempts to clean it up, unifies error reporting between
various object writers and uses error() on couple more places.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The same change as the previous. It is rather sad that commit log
message parser gives list of chomped lines while tag message parser
gives unchomped ones.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This revealed that the output from blame and tag was not chomped
properly and was relying on HTML output not noticing that extra
whitespace that resulted from the newline, which was also fixed.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Just make it take over blame's place. Documentation and command
have all stopped mentioning "git-pickaxe". The built-in synonym
is left in the command table, so you can still say "git pickaxe",
but it probably is a good idea to retire it as well.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Otherwise, commit log template would get the remainder of the
filename start on a new line unquoted and the log gets messed
up.
I initially considered using the full quote_c_style(), but the
output from the command is primarily for human consumption so
chose to leave other control characters and bytes with high-bits
unmolested.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Replace "gitweb diff header" with its full sha1 of blobs and replace
it by "git diff" header and extended diff header. Change also somewhat
highlighting of diffs.
Added `file_type_long' subroutine to convert file mode in octal to
file type description (only for file modes which used by git).
Changes:
* "gitweb diff header" which looked for example like below:
file:_<sha1 before>_ -> file:_<sha1 after>_
where 'file' is file type and '<sha1>' is full sha1 of blob is
changed to
diff --git _a/<file before>_ _b/<file after>_
In both cases links are visible and use default link style. If file
is added, a/<file> is not hyperlinked. If file is deleted, b/<file>
is not hyperlinked.
* there is added "extended diff header", with <path> and <hash>
hyperlinked (and <hash> shortened to 7 characters), and <mode>
explained: '<mode>' is extended to '<mode> (<file type description>)',
where added text is slightly lighter to easy distinguish that it
was added (and it is difference from git-diff output).
* from-file/to-file two-line header lines have slightly darker color
than removed/added lines.
* chunk header has now delicate line above for easier finding chunk
boundary, and top margin of 2px, both barely visible.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Instead of simply hiding control characters in esc_path by replacing
them with '?', use Character Escape Codes (CEC) i.e. alphabetic
backslash sequences like those found in C programming language and
many other languages influenced by it, such as Java and Perl. If
control characted doesn't have corresponding character escape code,
use octal char sequence to escape it.
Alternatively, controls can be replaced with Unicode Control
Pictures U+2400 - U+243F (9216 - 9279), the Unicode characters
reserved for representing control characters when it is
necessary to print or display them.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Extend unquote subroutine, which unquotes quoted and escaped filenames
which git may return, to deal not only with octal char sequence
quoting, but also quoting ordinary characters including '\"' and '\\'
which are respectively quoted '"' and '\', and to deal also with
C escape sequences including '\t' for TAB and '\n' for LF.
Add esc_path subroutine for gitweb quoting and HTML escaping filenames
(currently it does equivalent of ls' --hide-control-chars, which means
showing undisplayable characters (including '\n' and '\t') as '?'
(question mark) character, and use 'span' element with cntrl CSS class
to help rendering them differently.
Convert gitweb to use esc_path correctly to print pathnames.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
A forked project is defined to be $projname/$forkname.git for
$projname.git; the code did not check this correctly and mistook
$projname/.git to be a fork of itself. This minimally fixes the
breakage.
Also forks were not checked when index.aux file was in use.
Listing the forked ones in index.aux would show them also on the
toplevel index which may go against the hierarchical nature of
forks, but again this is a minimal fix to whip it in a better
shape suitable to be in the 'master' branch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Apparently this code was never tested without "forks". check-feature
returns a one-element list (0) when disabled, and assigning that to a
scalar variable made it to be called in a scalar context, which meant
my $check_forks = gitweb_check_feature("forks") were always 1!
Signed-off-by: Junio C Hamano <junkio@cox.net>
With this,
git pickaxe -L '/--progress/,+20' v1.4.0 -- pack-objects.c
gives you 20 lines starting from the first occurrence of
'--progress' in pack-objects, digging from v1.4.0 version.
You can also say
git pickaxe -L '/--progress/,-5' v1.4.0 -- pack-objects.c
Signed-off-by: Junio C Hamano <junkio@cox.net>
This adds documentation for --progress and --all-progress, remove a
duplicate --progress handling and make usage string more readable.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
In wt-status.c there is a test which does nothing.
This patch removes it.
Signed-off-by: Tero Roponen <teanropo@jyu.fi>
Signed-off-by: Junio C Hamano <junkio@cox.net>
* jc/read-tree:
t6022: ignoring untracked files by merge-recursive when they do not matter
merge-recursive: adjust to loosened "working file clobbered" check
merge-recursive: make a few functions static.
merge-recursive: use abbreviated commit object name.
merge: loosen overcautious "working file will be lost" check.
* np/index-pack:
remove .keep pack lock files when done with refs update
have index-pack create .keep file more carefully
improve fetch-pack's handling of kept packs
git-fetch can use both --thin and --keep with fetch-pack now
Teach receive-pack how to keep pack files based on object count.
Allow pack header preprocessing before unpack-objects/index-pack.
Remove unused variable in receive-pack.
Revert "send-pack --keep: do not explode into loose objects on the receiving end."
missing small substitution
Teach git-index-pack how to keep a pack file.
Only repack active packs by skipping over kept packs.
Allow short pack names to git-pack-objects --unpacked=.
send-pack --keep: do not explode into loose objects on the receiving end.
index-pack: minor fixes to comment and function name
enhance clone and fetch -k experience
mimic unpack-objects when --stdin is used with index-pack
add progress status to index-pack
make index-pack able to complete thin packs.
enable index-pack streaming capability
* maint:
Documentation: Transplanting branch with git-rebase --onto
merge-recursive implicitely depends on trust_executable_bit
adjust_shared_perm: chmod() only when needed.
Fix git-runstatus for repositories containing a file named HEAD
With this change, you can specify the beginning and the ending
line of the range you wish to inspect with pattern matching.
For example, these are equivalent with the git.git sources:
git pickaxe -L 7,21 v1.4.0 -- commit.c
git pickaxe -L '/^struct sort_node/,/^}/' v1.4.0 -- commit.c
git pickaxe -L '7,/^}/' v1.4.0 -- commit.c
git pickaxe -L '/^struct sort_node/,21' v1.4.0 -- commit.c
Signed-off-by: Junio C Hamano <junkio@cox.net>
Added example of transplantig feature branch from one development
branch (for example "next") into the other development branch (for
example "master").
[jc: talking Carl's advice this contains both examples sent to
the list by Jakub in his original message.]
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Read the configuration in to get core.filemode value for this
particular repository.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
When widening permission for files and directories in a 'shared'
repository for a user with inappropriate umask() setting for
shared work, make sure we call chmod() only when we actually
need to.
The primary idea owes credit to Johannes.
Signed-off-by: Junio C Hamano <junkio@cox.net>
The wt_status_print_updated() and wt_status_print_untracked() routines
call setup_revisions() with 'HEAD' being the reference to the tip of the
current branch. However, setup_revisions() gets confused if the branch
also contains a file named 'HEAD' resulting in a fatal error.
Instead, don't pass an argv to setup_revisions() at all; simply give it no
arguments, and make 'HEAD' the default revision.
Bug noticed by Rocco Rutte <pdmef@gmx.net>.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This change removes between 1 and 4 sed invocations per completion
entered by the user. In the case of cat-file the 4 invocations per
completion can take a while on Cygwin; running these replacements
directly within bash saves some time for the end user.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Now that log, whatchanged, rev-list, etc. support the symmetric
difference operator '...' we should provide bash completion for it
just like we do for '..'.
While we are at it we can remove two sed invocations during the
interactive prompt and replace them with internal bash operations.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
If the user has setup a command line of "git --git-dir=baz" then
anything we complete must be performed within the scope of "baz"
and not the current working directory.
This is useful with commands such as "git --git-dir=git.git log m"
to complete out "master" and view the log for the master branch of
the git.git repository. As a nice side effect this also works for
aliases within the target repository, just as git would honor them.
Unfortunately because we still examine arguments by absolute position
in most of the more complex commands (e.g. git push) using --git-dir
with those commands will probably still cause completion to fail.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Now that Git natively supports remote specifications within the
config file such as:
[remote "origin"]
url = ...
we should provide bash completion support "out of the box" for
these remotes, just like we do for the .git/remotes directory.
Also cleaned up the __git_aliases expansion to use the same form
of querying and filtering repo-config as this saves two fork/execs
in the middle of a user prompted completion. Finally also forced
the variable 'word' to be local within __git_aliased_command.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>