Commit Graph

11004 Commits

Author SHA1 Message Date
Jakub Narebski
01ac1e38db gitweb: Show submodule entries in the 'tree' view
Add S_ISGITLINK subroutine and S_IFGITLINK, S_IFINVALID constants.
Add support for "commit" (submodule) entries in the tree object to
mode_str ('m---------', following cgit), file_type and file_type_long
('submodule') subroutines.

There is only link to the history of submodule entry in the
supermodule (current repository) for now, because gitweb doesn't know
where to search for submodule repository objects.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-28 18:46:32 -07:00
Jeff King
90ae710e0b Documentation/git-diff: remove -r from --name-status example
Calling 'git-diff --name-status' will recursively show any
changes already, and it has for quite some time (at least as
far back as v1.4.1).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-28 18:44:52 -07:00
Junio C Hamano
83b3df7d58 git-stash apply --index: optimize postprocessing
Originally, "apply --index" codepath was bolted on to the
"update working tree files and index, but then revert the
changes we make to the index except for added files so that we
do not forget about them" codepath, almost as an afterthought.
Because "apply --index" first prepares the final index state
upfront, "revert except the added paths" postprocessing does not
have to be done.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-28 00:06:00 -07:00
Junio C Hamano
cbeaccc316 Fix git-stash apply --index
Two bugs that made the command practically unusable were fixed
with this.

 - A stash created with a clean index does not have any
   difference between the base tree and the index tree.
   Trying to apply the diff between them to the index would
   error out with "No changes".  Even when the user asked to
   unstash with --index, do not bother with --index action if
   the base tree and the index tree match.

 - After successfully performing the working tree merge, the
   index was reloaded from an earlier state of unstashed index
   with "read-tree"; this left all the paths cache dirty.  By
   moving the call to git-status after this read-tree, match the
   cached stat information in the index.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-28 00:06:00 -07:00
しらいしななこ
f12e925ac2 git-stash: Make sure reflog is created for refs/stash
Earlier commit 7ab3cc70 fixed "stash clear" but broke save_stash,
because it forgot to make sure the reflog file exists before saving.

Signed-off-by: Nanako Shiraishi <nanako3@bluebottle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-28 00:06:00 -07:00
Junio C Hamano
11bb2d4fa9 Merge branch 'master' of git://git.kernel.org/pub/scm/gitk/gitk
* 'master' of git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Fix bugs in the Find function
  gitk: Wait for the window to become visible after creating it
  [PATCH] gitk: Bind keyboard actions to the command key on Mac OS
  [PATCH] gitk: Ignore ctrl-z as EOF on windows
  gitk: Make the fake commit for the index changes green rather than magenta
  gitk: Show changes in index and changes in working directory separately
2007-07-28 00:05:40 -07:00
Johannes Schindelin
fb47cfbd59 rebase -i: fix interrupted squashing
When a squashing merge failed, the first commit would not be replaced,
due to "git reset --soft" being called with an unmerged index.

Noticed by Uwe Kleine-König.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-27 10:59:42 -07:00
Junio C Hamano
7ab3cc70a6 git-stash: do not remove a ref by hand.
Somebody on #git noticed that "git stash clear" left a packed
ref behind for ref/stash.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-26 23:24:28 -07:00
Brian Gernhardt
383e45cec4 Document commit.template configuration variable.
Add it to the list in config.txt and explicitly say that the
--template option to git-commit overrides the configuration variable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-26 16:57:24 -07:00
Paul Mackerras
005a2f4e6d gitk: Fix bugs in the Find function
This fixes the problem reported by Brian Downing where searching for
a string that doesn't exist would give a Tcl error.  The basic problem
was that we weren't reading the data for the last commit since it
wasn't terminated with a null.  This effectively adds a null on the end
(if there isn't one already) to make sure we process the last commit.

This also makes the yellow background behind instances of the search
string appear more consistently, and fixes a bug where the "/" key
would just find the same commit again and again instead of advancing.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-26 22:36:39 +10:00
Junio C Hamano
654a7ccc56 Update description of -z option.
The NUL you see in "git log" (without diff) output are between records,
not at the end of each record.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 23:45:42 -07:00
Johannes Schindelin
91e1ee7762 rebase -i: fix overzealous output redirection
When squashing, you no longer saw what the editor had to say to you
after commit 'Shut "git rebase -i" up when no --verbose was given'
(if you used a console based editor, at least).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 23:38:43 -07:00
Nguyễn Thái Ngọc Duy
b87841e164 git-write-tree should not crash if prefix does not exist
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 21:35:17 -07:00
Junio C Hamano
e7a7be8831 git_mkstemp(): be careful not to overflow the path buffer.
If user's TMPDIR is insanely long, return negative after
setting errno to ENAMETOOLONG, pretending that the underlying
mkstemp() choked on a temporary file path that is too long.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 21:34:53 -07:00
Junio C Hamano
d58e8d34b0 When locking in a symlinked repository, try to lock the original.
In a working tree prepared in new-workdir (in contrib/), some files in .git/
directory are symbolic links to the original repository.  The usual sequence of
lock-write-rename would break the symbolic link.

Ideally we should resolve relative symbolic link with maxdepth, but I do not
want to risk too elaborate patch before 1.5.3 release, so this is a minimum
and trivially obvious fix.  new-workdir creates its symbolic links absolute,
and does not link from a symlinked workdir, so this fix should suffice for now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 16:22:55 -07:00
Junio C Hamano
1a44be9a0f git-submodule: remove redundant call to git-describe
The code to find a more descriptive name given a commit in a
submodule were improved in bffe71f, but it forgot to remove the
older logic the patch replaced.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 16:13:55 -07:00
Simon Hausmann
b2d2d16af7 git-p4: Fix p4 user cache population on Windows.
Fall back to USERPROFILE if HOME isn't set.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 16:06:54 -07:00
Junio C Hamano
537601ac74 git-submodule module_name: avoid using unwieldy "value_regexp" feature.
"module_name $path" function wants to look up a configuration
variable "submodule.<modulename>.path" whose value is $path, and
return the <modulename> found.  "git-config --get-regexp" is the
natural thing to use for this, but (1) its value matching has an
unfortunate "feature" that takes leading '!' specially, and (2)
its output needs to be parsed with sed to extract <modulename>
part anyway.

This changes the call to "git-config --get-regexp" not to use
the value-regexp part, and moves the "pick the one whose value
is $path" part to the downstream sed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 15:51:26 -07:00
Junio C Hamano
887c5266d6 gitweb: fix broken snapshot
Recent updates to snapshot code had a typo that broke the command line to
invoke underlying "git archive" command.  This is a simple typofix for it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 15:50:42 -07:00
Junio C Hamano
ceff079bdc Make sure git-stash works from subdirectory.
We say "SUBDIRECTORY_OK" but we did not chdir to toplevel; this
is fine as long as everything we use can be started from a
subdirectory, but unfortunately "merge-recursive" is not one of
the programs you can safely use from a subdirectory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 15:34:52 -07:00
Robin Rosenberg
4eb994733d Document --unified/-U option
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 13:27:26 -07:00
Junio C Hamano
f48a203a56 GIT 1.5.3-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:53 -07:00
Alexandre Julliard
ceefa44fe2 git.el: Pass an explicit argument to enable smerge-mode.
Without argument the mode is toggled, which would do the wrong thing
if the file was already open.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:38 -07:00
Jim Meyering
1c911dc86c pretty-options.txt: tiny doc fix
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:38 -07:00
Junio C Hamano
c4eaed49c2 t9200: Be careful when checking CVS/Entries
CVS/Entries file can contain a line with single D to say "this
directory does not have any subdirectories".  Do not get
confused with such an entry.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:38 -07:00
Johannes Schindelin
ca193cf1ad git am: skip pine's internal folder data
Test if the From: line contains "Mail System Internal Data" and if
it is, skip this mail.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 20:48:04 -07:00
Steven Grimm
d1cc130a5e Teach git-commit about commit message templates.
These are useful in organizations that enforce particular formats
for commit messages, e.g., to specify bug IDs or test plans.
Use of the template is not enforced; it is simply used as the
initial content when the editor is invoked.

Signed-off-by: Steven Grimm <koreth@midwinter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 20:46:54 -07:00
Johannes Schindelin
af66366a9f Teach approxidate() to understand "never"
If you want to keep the reflogs around for a really long time, you should be
able to say so:

	$ git config gc.reflogExpire never

Now it works, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
Johannes Schindelin
7b69b873fa git log -g: Complain, but do not fail, when no reflogs are there
When asking "git log -g --all", clearly you want to see only those refs
that do have reflogs, but you do not want it to fail, either.

So instead of die()ing, complain about it, but move on to the other refs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
Kumar Gala
2d8ae400d1 send-email: Update regex parsing for pine aliases
The pine address book format is tab seperated and the first field
is the nickname/alias and the third field is the email address as
per:

http://www.washington.edu/pine/tech-notes/low-level.html

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
Robin Rosenberg
f836f1ae9b cvsexportcommit: avoid racy CVS problem.
If git cvsexportcommit is executed fast enough in sequence, the CVS
timestamps could end up being the same. CVS tries to fix this
by sleeping until the CPU clock changes seconds. Unfortunately,
the CPU clock and the file system clock are not necessarily the same, so
the timestamps could be the same anyway. When that happens CVS may not
recognize changed files and cvs will forget to commit some files.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
René Scharfe
1843d8d545 cleanup unpack-trees.c: shrink struct tree_entry_list
Remove the two write-only fields executable and symlink from struct
tree_entry_list.  Also replace usage of the field directory with
S_ISDIR checks on the mode field, and then remove this now obsolete
field, too.  Noticed by David Kastrup.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
René Scharfe
24d0063494 filter-branch: fix dash complaining about "Missing '))'"
On e.g. Ubuntu, dash is used as /bin/sh.  Unlike bash it parses
commands like

  a=$((echo stuff) | wc)

as an arithmetic expression while what we want is a subshell inside
a command substitution.  Resolve the ambiguity by placing a space
between the two opening parentheses.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:28:10 -07:00
Jakub Narebski
3473e7df5f gitweb: More detailed error messages for snapshot format
Improve error messages for snapshot format in git_snapshot:
distinguish between situation where snapshots are turned off, where
snapshot format ('sf') parameter is invalid, where given snapshot
format does not exist in %known_snapshot_formats hash, and where
gitweb was given unsupported snapshot format.

While at it, use first from all supported snapshots format as default,
if no snapshot format was provided.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 17:26:04 -07:00
Alexandre Julliard
93c22eeb30 git.el: Support for incremental status updates.
When we know which files have been modified, we can now run diff-index
or ls-files with a file list to refresh only the specified files
instead of the whole project.

This also allows proper refreshing of files upon add/delete/resolve,
instead of making assumptions about the new file state.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 03:16:26 -07:00
Junio C Hamano
1130845be8 user-manual: fix typolets.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 01:58:56 -07:00
Junio C Hamano
1cffddd654 Mark user-manual as UTF-8
There have been several complaints against k.org's user-manual
page.  The document is generated in ISO-8859-1 by the xsltproc
toolchain (I suspect this is because released docbook.xsl we use
has xsl:output element that says the output is ISO-8859-1) but
server delivers it with "charset=UTF-8", and all h*ll breaks
loose.

This attempts to force UTF-8 on the generating end.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 00:47:05 -07:00
Johannes Schindelin
8e64006eee Teach revision machinery about --no-walk
The flag "no_walk" is present in struct rev_info since a long time, but
so far has been in use exclusively by "git show".

With this flag, you can see all your refs, ordered by date of the last
commit:

$ git log --abbrev-commit --pretty=oneline --decorate --all --no-walk

which is extremely helpful if you have to juggle with a lot topic
branches, and do not remember in which one you introduced that uber
debug option, or simply want to get an overview what is cooking.

(Note that the "git log" invocation above does not output the same as

 $ git show --abbrev-commit --pretty=oneline --decorate --all --quiet

 since "git show" keeps the alphabetic order that "--all" returns the
 refs in, even if the option "--date-order" was passed.)

For good measure, this also adds the "--do-walk" option which overrides
"--no-walk".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 23:57:50 -07:00
Johannes Schindelin
dfd05e38f0 filter-branch: Big syntax change; support rewriting multiple refs
We used to take the first non-option argument as the name for the new
branch.  This syntax is not extensible to support rewriting more than just
HEAD.

Instead, we now have the following syntax:

	git filter-branch [<filter options>...] [<rev-list options>]

All positive refs given in <rev-list options> are rewritten.  Yes,
in-place.  If a ref was changed, the original head is stored in
refs/original/$ref now, for your inspecting pleasure, in addition to the
reflogs (since it is easier to inspect "git show-ref | grep original" than
to inspect all the reflogs).

This commit also adds the --force option to remove .git-rewrite/ and all
refs from refs/original/ before filtering.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 23:15:09 -07:00
Johannes Schindelin
3b38ec16d5 rebase -i: exchange all "if [ .. ]" by "if test .."
This patch is literally

:%s/if \[ *\(.*[^ ]\) *\]/if test \1/

in vi, after making sure that the other instances of "[..]" are not
actually invocations of "test".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 23:06:12 -07:00
Johannes Schindelin
dfa49f3348 Shut "git rebase -i" up when no --verbose was given
Up to now, git rebase -i was quite chatty, showing through all the
nice core programs it called.

Now it only shows a progress meter by default.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 23:04:15 -07:00
Johannes Schindelin
7296096c9d mailinfo: fix 'fatal: cannot convert from utf-8 to utf-8'
For some reason, I got this error message.  Maybe it does not make sense,
but then we should not really try to convert the text when it is not
necessary.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-23 22:38:50 -07:00
Paul Mackerras
0eafba1405 gitk: Wait for the window to become visible after creating it
When the git log process returned an error immediately, we were
sometimes getting no main window and no error window displayed,
with the gitk process just hanging waiting for something.  It appears
that the tkwait in show_error, which waits for the error window to
be destroyed, wasn't sufficient to allow the main window or the error
window to be mapped.

This adds a wait in the main startup code after the main window
has been created to wait until it is visible.  This seems to fix the
problem.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-23 21:35:03 +10:00
Jakub Narebski
a781785d8f gitweb: Fix support for legacy gitweb config for snapshots
Earlier commit which cleaned up snapshot support and introduced
support for multiple snapshot formats changed the format of
$feature{'snapshot'}{'default'} (gitweb configuration) and
gitweb.snapshot configuration variable (repository configuration).
It supported old gitweb.snapshot values of 'gzip', 'bzip2' and 'zip'
and tried to support, but failed to do that, old values of
$feature{'snapshot'}{'default'}; at least those corresponding to
old gitweb.snapshot values of 'gzip', 'bzip2' and 'zip', i.e.
  ['x-gzip', 'gz', 'gzip']
  ['x-bzip2', 'bz2', 'bzip2']
  ['x-zip', 'zip', '']

This commit moves legacy configuration support out of feature_snapshot
subroutine to separate filter_snapshot_fmts subroutine. The
filter_snapshot_fmts is used on result on result of
gitweb_check_feature('snapshot').  This way feature_snapshot deals
_only_ with repository config.

As a byproduct you can now use 'gzip' and 'bzip2' as aliases to 'tgz'
and 'tbz2' also in $feature{'snapshot'}{'default'}, not only in
gitweb.snapshot.

While at it do some whitespace cleanup: use tabs for indent, but
spaces for align.

Noticed-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Tested-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22 16:35:50 -07:00
Johannes Schindelin
16a7fcfe5e fsck --lost-found: write blob's contents, not their SHA-1
When looking for a lost blob, it is much nicer to be able to grep
through .git/lost-found/other/* than to write an inefficient loop
over the file names.  So write the contents of the dangling blobs,
not their object names.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22 15:59:27 -07:00
Shawn O. Pearce
d23d98d3ba [PATCH] gitk: Bind keyboard actions to the command key on Mac OS
git-gui already uses the command key for accelerators, but gitk has
never done so.  I'm actually finding it very hard to move back and
forth between the two applications as git-gui is following the Mac
OS X conventions and gitk is not.

This trick is the same one that git-gui uses to determine which
key to bind actions to.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-22 22:25:46 +10:00
Mark Levedahl
86da5b6c97 [PATCH] gitk: Ignore ctrl-z as EOF on windows
Cygwin's Tcl is configured to honor any occurence of ctrl-z as an
end-of-file marker, while some commits in the git repository and possibly
elsewhere include that character in the commit comment. This causes gitk
ignore commit history following such a comment and incorrect graphs. This
change affects only Windows as Tcl on other platforms already has
eofchar == {}. This fixes problems noted by me and by Ray Lehtiniemi, and
the fix was suggested by Shawn Pierce.

Signed-off-by: Mark Levedahl <mdl123@verizon.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-22 22:25:46 +10:00
Paul Mackerras
ef3192b834 gitk: Make the fake commit for the index changes green rather than magenta
The magenta was a bit close in color to the normal blue commits.  This
makes them green instead as suggested by Linus.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-22 22:05:30 +10:00
Marco Costalba
c4640fe8d9 Avoid to duplicate commit message when is not encoded
When a commit message doesn't have encoding information
and encoding output is utf-8 (default) then an useless
xstrdup() of commit message is done.

If we assume most of users live in an utf-8 world, this
useless copy is the common case.

Performance issue found with KCachegrind.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22 01:40:21 -07:00
Junio C Hamano
e5633cbb85 Synonyms: -i == --regexp-ignore-case, -E == --extended-regexp
These options to log family were too long to type.  Give them
shorter synonyms.

Fix the parsing of the long options while at it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22 01:38:26 -07:00