summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2007-03-12git-bundle: only die if pack would be empty, warn if ref is skippedJohannes Schindelin
A use case for git-bundle expected to be quite common is this: $ git bundle create daily.bundle --since=10.days.ago --all The expected outcome is _not_ to error out if only a couple of the refs were not changed during the last 10 days. This patch complains loudly about refs which are skipped due to the pack not containing the corresponding objects, but dies only if no objects would be in the pack _at all_. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12git-send-email: configurable bcc and chain-reply-toAvi Kivity
Chain-reply-to is a personal perference, and is unlikely to change from patchset to patchset. Similarly, bcc is likely to have the same values every invocation is one likes to bcc oneself. So, allow both to be set via configuration variables. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12Merge branch 'maint'Junio C Hamano
* maint: git-send-email: Document configuration options git-merge: warn when -m provided on a fast forward
2007-03-12git-send-email: Document configuration optionsAvi Kivity
Wishing to implement an email aliases file, I found that they were already implmented. Document them for the next user. Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12git-merge: warn when -m provided on a fast forwardJ. Bruce Fields
Warn the user that the "-m" option is ignored in the case of a fast forward. That may save some confusion in the case where the user doesn't know about fast forwards yet and may not realize that the behavior here is intentional. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12Merge branch 'jc/boundary'Junio C Hamano
* jc/boundary: git-bundle: prevent overwriting existing bundles git-bundle: die if a given ref is not included in bundle git-bundle: handle thin packs in subcommand "unbundle" git-bundle: Make thin packs git-bundle: avoid packing objects which are in the prerequisites bundle: fix wrong check of read_header()'s return value & add tests revision --boundary: fix uncounted case. revision --boundary: fix stupid typo git-bundle: make verify a bit more chatty. revision traversal: SHOWN means shown git-bundle: various fixups revision traversal: retire BOUNDARY_SHOW revision walker: Fix --boundary when limited
2007-03-12Change {pre,post}-receive hooks to use stdinShawn O. Pearce
Sergey Vlasov, Andy Parkins and Alex Riesen all pointed out that it is possible for a single invocation of receive-pack to be given more refs than the OS might allow us to pass as command line parameters to a single hook invocation. We don't want to break these up into multiple invocations (like xargs might do) as that makes it impossible for the pre-receive hook to verify multiple related ref updates occur at the same time, and it makes it harder for post-receive to send out a single batch notification. Instead we pass the reference data on a pipe connected to the hook's stdin, supplying one ref per line to the hook. This way a single hook invocation can obtain an infinite amount of ref data, without bumping into any operating system limits. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12Split back out update_hook handling in receive-packShawn O. Pearce
Since we have decided to change the calling conventions for the pre-receive and post-receive hooks to take the ref data on stdin rather than on the command line we cannot use the same logic to invoke the update hook anymore. So we take a small step backwards towards what we used to have, and create a specialized function for executing just the update hook. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12Refactor run_command error handling in receive-packShawn O. Pearce
I'm pulling the error handling used to decode the result of run_command up into a new function so that I can reuse it. No changes, just a simple code movement. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12Teach run_command how to setup a stdin pipeShawn O. Pearce
Sometimes callers trying to use run_command to execute a child process will want to setup a pipe or file descriptor to redirect into the child's stdin. This idea is completely stolen from builtin-bundle's fork_with_pipe, written by Johannes Schindelin. All credit (and blame) should lie with Dscho. ;-) Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12Split run_command into two halves (start/finish)Shawn O. Pearce
If the calling process wants to send data to stdin of a child process it will need to arrange for a pipe and get the child process running, feed data to it, then wait for the child process to finish. So we split the run function into two halves, allowing callers to first start the child then later finish it. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12Start defining a more sophisticated run_commandShawn O. Pearce
There are a number of places where we do some variation of fork()+exec() but we also need to setup redirection in the process, much like what run_command does for us already with its option flags. It would be nice to reuse more of the run_command logic, especially as that non-fork API helps us to port to odd platforms like Win32. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12Remove unused run_command variantsShawn O. Pearce
We don't actually use these va_list based variants of run_command anymore. I'm removing them before I make further improvements. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12Switch to run_command_v_opt in revertShawn O. Pearce
Another change by me is removing the va_list variants of run_command, one of which is used by builtin-revert.c. To avoid compile errors I'm refactoring builtin-revert to use the char** variant instead, as that variant is staying. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-12cvsserver: Use Merged response instead of Update-existing for merged filesFrank Lichtenheld
Using Update-existing leads to the client forgetting about the "locally modified" status of the file which can lead to loss of local changes on later updates. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Acked-by: Martin Langhoff <martin.langhoff@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11I like the idea of the new ':/<oneline prefix>' notation, and gave itJim Meyering
a try, but all I could get was a segfault. It was dereferencing a NULL commit list. Fix below. With it, this example now works: $ mkdir .j; cd .j; touch f $ git-init; git-add f; git-commit -mc f; echo x >f; git-commit -md f $ git-diff -p :/c :/d diff --git a/f b/f index e69de29..587be6b 100644 --- a/f +++ b/f @@ -0,0 +1 @@ +x Signed-off-by: Jim Meyering <jim@meyering.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11Merge branch 'js/attach'Junio C Hamano
* js/attach: format-patch --attach: not folding some long headers. format-patch: add --inline option and make --attach a true attachment
2007-03-11Merge branch 'js/diff-ni'Junio C Hamano
* js/diff-ni: Get rid of the dependency to GNU diff in the tests diff --no-index: support /dev/null as filename diff-ni: fix the diff with standard input diff: support reading a file from stdin via "-"
2007-03-11Merge branch 'jc/fsck'Junio C Hamano
* jc/fsck: fsck: exit with non-zero status upon errors unpack_sha1_file(): detect corrupt loose object files. fsck: fix broken loose object check.
2007-03-11Merge branch 'pb/commit-i'Junio C Hamano
* pb/commit-i: git-commit: add a --interactive option
2007-03-11Merge branch 'js/revert-cherry'Junio C Hamano
* js/revert-cherry: cherry-pick: Bug fix 'cherry picked from' message. cherry-pick: Suggest a better method to retain authorship Make git-revert & git-cherry-pick a builtin
2007-03-11Merge branch 'sp/make'Junio C Hamano
* sp/make: Allow "make -w" generate its usual output Support of "make -s": do not output anything of the build itself More build output cleaning up Make 'make' quiet by default Make 'make' quieter while building git
2007-03-11Merge branch 'maint'Junio C Hamano
* maint: git.el: Retrieve commit log information from .dotest directory. git.el: Avoid appending a signoff line that is already present. setup_git_directory_gently: fix off-by-one error user-manual: install user manual stylesheet with other web documents user-manual: fix rendering of history diagrams user-manual: fix missing colon in git-show example user-manual: fix inconsistent use of pull and merge user-manual: fix inconsistent example glossary: fix overoptimistic automatic linking of defined terms Documentation: s/seperator/separator/ Adjust reflog filemode in shared repository
2007-03-11git.el: Retrieve commit log information from .dotest directory.Alexandre Julliard
If a git-am or git-rebase is in progress, fill the commit log buffer from the commit information found in the various files in the .dotest directory. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11git.el: Avoid appending a signoff line that is already present.Alexandre Julliard
Also avoid inserting an extra newline if other signoff lines are present. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11setup_git_directory_gently: fix off-by-one errorMatthias Lederhofer
don't tell getcwd that the buffer has one spare byte for an extra / Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-11Merge branch 'maint' of git://linux-nfs.org/~bfields/git into maintJunio C Hamano
* 'maint' of git://linux-nfs.org/~bfields/git: user-manual: install user manual stylesheet with other web documents user-manual: fix rendering of history diagrams user-manual: fix missing colon in git-show example user-manual: fix inconsistent use of pull and merge user-manual: fix inconsistent example glossary: fix overoptimistic automatic linking of defined terms
2007-03-11user-manual: install user manual stylesheet with other web documentsJ. Bruce Fields
Install the stylesheet needed for the user manual. This should solve the problem of, e.g., http://www.kernel.org/pub/software/scm/git/docs/user-manual.html lacking a lot of formatting. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-03-11user-manual: fix rendering of history diagramsJ. Bruce Fields
Asciidoc appears to interpret a backslash at the end of a line as escaping the end-of-line character, which screws up the display of history diagrams like o--o--o \ o--... The obvious fix (replacing "\" by "\\") doesn't work. The only workaround I've found is to include all such diagrams in a LiteralBlock. Asciidoc claims that should be equivalent to a literal paragraph, so I don't understand why the difference--perhaps it's an asciidoc bug. Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-03-11user-manual: fix missing colon in git-show exampleJ. Bruce Fields
There should be a colon in this git-show example. Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-03-11user-manual: fix inconsistent use of pull and mergeJ. Bruce Fields
I used "git pull ." instead of "git merge" here without any explanation. Stick instead to "git merge" for now (the equivalent pull syntax is still covered in a later chapter). Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-03-11user-manual: fix inconsistent exampleJ. Bruce Fields
The configuration file fragment here is inconsistent with the text above. Thanks to Ramsay Jones for the correction. Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-03-11glossary: fix overoptimistic automatic linking of defined termsJ. Bruce Fields
The script sort_glossary.pl turns each use of "term" into a link to the definition of "term". To avoid mangling links like gitlink:git-term[1] it doesn't replace any occurence of "term" preceded by "link:git-". This fails for gitlink:git-symbolic-ref[1] when substituting for "ref". So instead just refuse to replace anything preceded by a "-". That could result in missing some opportunities, but that's a less annoying error. Actually I find the automatic substitution a little distracting; some day maybe we should just run it once and commit the result, so it can be hand-tuned. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
2007-03-10Documentation: s/seperator/separator/Jeff King
Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-10Adjust reflog filemode in shared repositoryMatthias Kestenholz
Without this, committing in a group-shared repository would not work even though all developers are in the same group. Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-09git-commit: add a --interactive optionPaolo Bonzini
The --interactive option behaves like "git commit", except that "git add --interactive" is executed before committing. It is incompatible with -a and -i. Signed-off-by: Paolo Bonzini <bonzini@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-09git-bundle: prevent overwriting existing bundlesJohannes Schindelin
Not only does it prevent accidentally losing older bundles, but it also fixes a subtle bug: when writing into an existing bundle, git-pack-objects would not truncate the bundle. Therefore, fetching from the bundle would trigger an error in unpack-objects: "fatal: pack has junk at the end". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-09git-bundle: die if a given ref is not included in bundleJohannes Schindelin
The earlier patch tried to be nice by just warning, but it seems more likely that the user wants to adjust the parameters. Also, it prevents a bundle containing _all_ revisions in the case when the user only gave one ref, but also rev-list options which excluded the ref. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-09git-bundle: handle thin packs in subcommand "unbundle"Johannes Schindelin
The patch to make the packs in a bundle thin forgot the receiving side. D'oh. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-08Merge branch 'js/config-rename'Junio C Hamano
* js/config-rename: git-config: document --rename-section, provide --remove-section
2007-03-08Merge branch 'master' of git://repo.or.cz/git/fastimportJunio C Hamano
* 'master' of git://repo.or.cz/git/fastimport: Allow fast-import frontends to reload the marks table Use atomic updates to the fast-import mark file Preallocate memory earlier in fast-import
2007-03-08git-bundle: Make thin packsJohannes Schindelin
Thin packs are way smaller, but they rely on the receiving end to have the base objects. However, Git's pack protocol also uses thin packs by default. So make the packs contained in bundles thin, since bundles are just another transport. The patch looks a bit bigger than intended, mainly because --thin _implies_ that pack-objects should run its own rev-list. Therefore, this patch removes all the stuff we used to roll rev-list ourselves. This commit also changes behaviour slightly: since we now know early enough if a specified ref is _not_ contained in the pack, we can avoid putting that ref into the pack. So, we don't die() here, but warn() instead, and skip that ref. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-08git-bundle: avoid packing objects which are in the prerequisitesJohannes Schindelin
When saying something like "--since=1.day.ago" or "--max-count=5", git-bundle finds the boundary commits which are recorded as prerequisites. However, it failed to tell pack-objects _not_ to pack the objects which are in these. Fix that. And add a test for that. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-07Allow fast-import frontends to reload the marks tableShawn O. Pearce
I'm giving fast-import a lesson on how to reload the marks table using the same format it outputs with --export-marks. This way a frontend can reload the marks table from a prior import, making incremental imports less painful. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-07Use atomic updates to the fast-import mark fileShawn O. Pearce
When we allow fast-import frontends to reload a mark file from a prior session we want to let them use the same file as they exported the marks to. This makes it very simple for the frontend to save state across incremental imports. But we don't want to lose the old marks table if anything goes wrong while writing our current marks table. So instead of truncating and overwriting the path specified to --export-marks we use the standard lockfile code to write the current marks out to a temporary file, then rename it over the old marks table. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-07Teach receive-pack to run pre-receive/post-receive hooksShawn O. Pearce
Bill Lear pointed out that it is easy to send out notifications of changes with the update hook, but successful execution of the update hook does not necessarily mean that the ref was actually updated. Lock contention on the ref or being unable to append to the reflog may prevent the ref from being changed. Sending out notifications prior to the ref actually changing is very misleading. To help this situation I am introducing two new hooks to the receive-pack flow: pre-receive and post-receive. These new hooks are invoked only once per receive-pack execution and are passed three arguments per ref (refname, old-sha1, new-sha1). The new post-receive hook is ideal for sending out notifications, as it has the complete list of all refnames that were successfully updated as well as the old and new SHA-1 values. This allows more interesting notifications to be sent. Multiple ref updates could be easily summarized into one email, for example. The new pre-receive hook is ideal for logging update attempts, as it is run only once for the entire receive-pack operation. It can also be used to verify multiple updates happen at once, e.g. an update to the `maint` head must also be accompained by a new annotated tag. Lots of documentation improvements for receive-pack are included in this change, as we want to make sure the new hooks are clearly explained. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-07Refactor handling of error_string in receive-packShawn O. Pearce
I discovered we did not send an ng line in the report-status feedback if the ref was not updated because the repository has the config option receive.denyNonFastForwards enabled. I think the reason this happened is that it is simply too easy to forget to set error_string when returning back a failure from update() We now return an ng line for a non-fastforward update, which in turn will cause send-pack to exit with a non-zero exit status. Hence the modified test. This refactoring changes update to return a const char* describing the error, which execute_commands always loads into error_string. The result is what I think is cleaner code, and allows us to initialize the error_string member to NULL when we read_head_info. I want error_string to be NULL in all commands before we call execute_commands, so that we can reuse the run_hook function to execute a new pre-receive hook. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-07Refactor run_update_hook to be more usefulShawn O. Pearce
This is a simple refactoring of run_update_hook to allow the function to be passed the name of the hook it runs and also to build the argument list from a list of struct commands, rather than just one struct command. The refactoring is to support new pre-receive and post-receive hooks that will be given the entire list of struct commands, rather than just one struct command. These new hooks will follow in another patch. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-07Don't run post-update hook unless a ref changedShawn O. Pearce
There is little point in executing the post-update hook if all refs had an error and were unable to be updated. In this case nothing new is reachable within the repository, and there is no state change for the post-update hook to be interested in. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-07Move post-update hook to after all other activityShawn O. Pearce
As the post-update hook is meant to run after we have completed the receipt of the pushed changes, and it might actually try to kick off a `repack -a -d`, we should delay on invoking it until after we have removed the *.keep file on the uploaded pack (if we kept the pack). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>