The command checked the presence of a ref by directly looking
into $GIT_DIR/refs directory. Update it to use show-ref.
Signed-off-by: Junio C Hamano <junkio@cox.net>
* sb/fetch: (41 commits)
merge and resolve: Output short hashes and .. in "Updating ..."
fetch: Misc output cleanup
gitweb: tree view: hash_base and hash are now context sensitive
fetch: Reset remote refs list each time fetch_main is called
Fix approxidate() to understand 12:34 AM/PM are 00:34 and 12:34
git-diff -B output fix.
Make cvsexportcommit remove files.
diff --stat: ensure at least one '-' for deletions, and one '+' for additions
diff --stat=width[,name-width]: allow custom diffstat output width.
gitweb: History: blob and tree are first, then commitdiff, etc
gitweb: Remove redundant "commit" from history
http/ftp: optionally ask curl to not use EPSV command
gitweb: Don't use quotemeta on internally generated strings
gitweb: Add snapshot to shortlog
gitweb: Factor out gitweb_have_snapshot()
gitweb: Remove redundant "commit" link from shortlog
gitweb: "alternate" starts with shade (i.e. 1)
git-format-patch: fix bug using -o in subdirectories
do not discard constness in interp_set_entry value argument
Fix approxidate() to understand more extended numbers
...
* jc/gitpm: (52 commits)
Remove -fPIC which was only needed for Git.xs
Git.pm: Kill Git.xs for now
Revert "Make it possible to set up libgit directly (instead of from the environment)"
Revert "Git.pm: Introduce fast get_object() method"
Revert "Convert git-annotate to use Git.pm"
Fix compilation with Sun CC
pass DESTDIR to the generated perl/Makefile
Eliminate Scalar::Util usage from private-Error.pm
Convert git-annotate to use Git.pm
Git.pm: Introduce fast get_object() method
Make it possible to set up libgit directly (instead of from the environment)
Work around sed and make interactions on the backslash at the end of line.
Git.pm: Introduce ident() and ident_person() methods
Convert git-send-email to use Git.pm
Git.pm: Add config() method
Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging
INSTALL: a tip for running after building but without installing.
Perly Git: make sure we do test the freshly built one.
Git.pm: Don't #define around die
Git.xs: older perl do not know const char *
...
In particular it removes duplicate information, uses short hashes (as
git-log and company) and uses .. for fast forwarding commits and ... for
not-fast-forwarding commits (shorter, easier to copy&paste). It also
reformat the output as:
1. the ones we store in our local ref (either branches or tags):
1a) fast-forward
* refs/heads/origin: fast forward to branch 'master' of ../git/
old..new: 1ad7a06..bc1a580
1b) same (only shown under -v)
* refs/heads/next: same as branch 'origin/next' of ../git/
commit: ce47b9f
1c) non-fast-forward, forced
* refs/heads/pu: forcing update to non-fast forward branch 'pu' of ../git/
old...new: 7c733a8...5faa935
1d) non-fast-forward, did not update because not forced
* refs/heads/po: not updating to non-fast forward branch 'po' of ../git/
old...new: 7c733a8...5faa935
1e) creating a new local ref to store
* refs/tags/v1.4.2-rc4: storing tag 'v1.4.2-rc4' of ../git/
tag: 8c7a107
* refs/heads/next: storing branch 'next' of ../git/
commit: f8a20ae
2. the ones we do not store in our local ref (only shown under -v):
* fetched branch 'master' of ../git
commit: 695dffe
* fetched tag 'v1.4.2-rc4' of ../git
tag: 8c7a107
Signed-off-by: Santi B.ANijar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
* jc/diff-stat:
diff --stat: ensure at least one '-' for deletions, and one '+' for additions
diff --stat=width[,name-width]: allow custom diffstat output width.
diff --stat: color output.
diff --stat: allow custom diffstat output width.
* lt/web:
gitweb: tree view: hash_base and hash are now context sensitive
gitweb: History: blob and tree are first, then commitdiff, etc
gitweb: Remove redundant "commit" from history
gitweb: Don't use quotemeta on internally generated strings
gitweb: Add snapshot to shortlog
gitweb: Factor out gitweb_have_snapshot()
gitweb: Remove redundant "commit" link from shortlog
gitweb: "alternate" starts with shade (i.e. 1)
gitweb: Add history and blame to git_difftree_body()
gitweb: Remove excessively redundant entries from git_difftree_body
Revert "gitweb: extend blame to show links to diff and previous"
gitweb: Quote filename in HTTP Content-Disposition: header
gitweb: Add git_url subroutine, and use it to quote full URLs
gitweb: Split validate_input into validate_pathname and validate_refname
gitweb: Use "return" instead of "return undef" for some subs
gitweb: Strip trailing slashes from $path in git_get_hash_by_path
gitweb: extend blame to show links to diff and previous
gitweb: Remove redundant "tree" link
gitweb: tree view: eliminate redundant "blob"
Now ref creation codepath in lock_ref_sha1() and friends notices
the directory/file conflict situation, we do not do this by hand
in git-branch anymore.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This implements deletion of a packed ref. Since it is a very
rare event to delete a ref compared to looking up, creating and
updating, this opts to remove the ref from the packed-ref file
instead of doing any of the filesystem based "negative ref" trick
to optimize the deletion path.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This cleans up the error path in the function so it does not
die() itself sometimes while signalling an error with NULL some
other times which was inconsistent and confusing.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Once we read packed and loose refs, for_each_ref() and friends
kept using them even after write_ref_sha1() and delete_ref()
changed the refs. This adds invalidate_cached_refs() as a way
to flush the cached information.
Signed-off-by: Junio C Hamano <junkio@cox.net>
It is normal to have .git/refs/heads/foo directory which is
empty after the last branch whose name starts with foo/ is
removed. Make sure we notice this case and allow creation of
branch foo by removing the empty directory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
In tree view, by default, hash_base is HEAD and hash is the
entry equivalent. Else the user had selected a hash_base or
hash, say by clicking on a revision or commit, in which case
those values are used.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Geert noticed that complete rewrite diff missed the usual a/ and b/
leading paths. Pickaxe says it never worked, ever.
Embarrassing.
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from bc1a580757 commit)
Somebody was wondering on #git channel why a git generated diff
does not apply with GNU patch when the filename contains a SP.
It is because GNU patch expects to find TAB (and trailing timestamp)
on ---/+++ (old_name and new_name) lines after the filenames.
The "diff --git" output format was carefully designed to be
compatible with GNU patch where it can, but whitespace
characters were always a pain.
We can make our output a bit more GNU patch friendly by adding an
extra TAB (but not trailing timestamp) to old/new name lines when
the filename as a SP in it. This updates git-apply to prepare
ourselves to accept such a patch, but we still do not generate
output that is patch friendly yet. That change needs to wait
until everybody has this change.
When a filename contains a real tab, "diff --git" format
always c-quotes it as discussed on the list with GNU patch
maintainer previously:
http://marc.theaimsgroup.com/?l=git&m=112927316408690&w=2
so there should be no downside.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This prevents the fetch of the heads again in the second call of fetch_main.
Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
The distinction between BASIC_ vs ALL_ is still kept, since it
is not Git.xs specific -- we could face the same issue when we
do other language bindings (e.g. Python).
Signed-off-by: Junio C Hamano <junkio@cox.net>
It just simplifies the whole thing to say
"hour = (hour % 12) + X"
where X is 12 for PM and 0 for AM.
It also fixes the "exact date" parsing, which didn't parse AM at all, and
as such would do the same "12:30 AM" means "12:30 24-hour-format" bug. Of
course, I hope that no exact dates use AM/PM anyway, but since we support
the PM format, let's just get it right.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Geert noticed that complete rewrite diff missed the usual a/ and b/
leading paths. Pickaxe says it never worked, ever.
Embarrassing.
Signed-off-by: Junio C Hamano <junkio@cox.net>
The number of '-' and '+' is still linear. The idea is that
scaled-length := floor(a * length + b) with the following constraints: if
length == 1, scaled-length == 1, and the combined length of plusses
and minusses should not be larger than the width by a small margin. Thus,
a + b == 1
and
a * max_plusses + b + a * max_minusses + b = width + 1
The solution is
a * x + b = ((width - 1) * (x - 1) + max_change - 1)
/ (max_change - 1)
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Reorder link display in history to be consistent with other
list displays: log, shortlog, etc. We now display:
blob | commitdiff
blob | commitdiff | diff_to_current
and
tree | commitdiff
Instead of the old history format where "blob" and "tree"
are between "commitdiff" and "diff_to_current" if present/
applicable.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Remove redundant "commit" from history -- it can be had
by clicking on the title of the commit. This commit
makes visualization consistent with shortlog, log, etc.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
If http.noEPSV config variable is defined and true, or if
GIT_CURL_FTP_NO_EPSV environment variable is defined, disable using
of EPSV ftp command (PASV will be used instead). This is helpful with
some "poor" ftp servers which does not support EPSV mode.
Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Do not use quotemeta on internally generated strings
such as filenames of snapshot, blobs, etc.
quotemeta quotes any characters not matching /A-Za-z_0-9/.
Which means that we get strings like this:
before: linux\-2\.6\.git\-5c2d97cb31fb77981797fec46230ca005b865799\.tar\.gz
after: linux-2.6.git-5c2d97cb31fb77981797fec46230ca005b865799.tar.gz
This patch fixes this.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Create gitweb_have_snapshot() which returns true
of snapshot is available and enabled, else false.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Remove the redundant "commit" link from shortlog.
It can be had by simply clicking on the entry title
of the row.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
When displaying a list of rows (difftree, shortlog, etc),
the first entry is now printed shaded, i.e. alternate is
initialized to 1, as opposed to non-shaded (alternate
initialized to 0).
This solves the problem when there is only one row to
display -- it is displayed shaded to visually indicate that
it is "active", part of a "list", etc.
(Compare this to the trivial case of more than one entry,
where the rows have alternating shade, thus suggesting
being part of a "list" of "active" entries, etc.)
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This was introduced by me in commit v1.4.2.1-gc08e524.
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
You can now say "5:35 PM yesterday", and approxidate() gets the right answer.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Our approxidate cannot handle simple times like "5 PM yesterday", and to
fix that, we will need to add some logic for number handling. This just
splits that out into a function of its own (the same way the _real_ date
parsing works).
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
When commiting a non-signed off contribution you cannot just add
a Signed-off-by: from the author as they did not sign it off.
But if you then commit it, and necessarily sign it off yourself,
the change appears to be yours. In this case it is common to use
the following form:
Commentry
From: originator <email>
Signed-of-by: me <my email>
Now that we have support for parsing Signed-off-by: for author
information it makes sense to handle From: as well. This patch
adds a new -F which will handle From: lines in the comments. It
may be used in combination with -S.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This is a set of bash completion routines for many of the
popular core Git tools. I wrote these routines from scratch
after reading the git-compl and git-compl-lib routines available
from the gitcompletion package at http://gitweb.hawaga.org.uk/
and found those to be lacking in functionality for some commands.
Consequently there may be some similarities but many differences.
Since these are completion routines only for tools shipped with
core Git and since bash is a popular shell on many of the native
core Git platforms (Linux, Mac OS X, Solaris, BSD) including these
routines as part of the stock package would probably be convienent
for many users.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This lets you say:
git log --all-match --author=Linus --committer=Junio --grep=rev-list
to limit commits that was written by Linus, committed by me and
the log message contains word "rev-list".
Signed-off-by: Junio C Hamano <junkio@cox.net>
This lets you say:
git grep --all-match -e A -e B -e C
to find lines that match A or B or C but limit the matches from
the files that have all of A, B and C.
This is different from
git grep -e A --and -e B --and -e C
in that the latter looks for a single line that has all of these
at the same time.
Signed-off-by: Junio C Hamano <junkio@cox.net>
With packed refs, there may not be a ".git/refs/heads/c" file
when branch c exists. And currently in this case, there is no check
to prevent creation of branch c/d.
This should probably be rewritten in C and done after the ref lock
has been taken to make sure no race exists though.
This is mainly to make all test cases in "t3210-pack-refs.sh" work.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Some of these test cases are from Junio.
One test case is commented out because it doesn't work right now.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>