aboutsummaryrefslogtreecommitdiffstats
path: root/stagit.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* in Atom (RFC4287) an atomTextConstruct specifies the type text as the defaultHiltjo Posthuma2023-04-101-2/+2
| | | | This saves a few bytes.
* prefix usage with the common prefix "usage: "Hiltjo Posthuma2022-08-161-1/+1
|
* Revert "remain compatible with slightly older libgit versions for now"Hiltjo Posthuma2022-05-271-2/+0
| | | | | | | | | This reverts commit 70541c5e2cbdc141ba94e76899aba5f07047cecf. Reported by Anton: The last commit[1] is not correct as GIT_OPT_SET_OWNER_VALIDATION is not a preprocessor directive but rather an enum. Causing the branch to never be entered.
* remain compatible with slightly older libgit versions for nowHiltjo Posthuma2022-05-241-0/+2
|
* Allow git to run on an other user repositoryAnton Lindqvist2022-05-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Reported by Anton: "Recent versions of libgit2 broke stagit for me due to the added opt-out GIT_OPT_SET_OWNER_VALIDATION configuration knob. My repositories are owned by root:vcs and I run stagit as another user which happens to be in vcs group but not the owner of the repository. Disabling the validation makes stagit work as expected again." Some notes: When using regular git it also provides a knob. This is due to a security concern in some cases, which is not applicable to stagit. git log somerepo fatal: unsafe repository ('somerepo' is owned by someone else) To add an exception for this directory, call: git config --global --add safe.directory somerepo See also / related: - https://github.blog/2022-04-12-git-security-vulnerability-announced/
* improve stream read and write error handlingHiltjo Posthuma2022-03-191-8/+27
|
* libgit2 config opts: set the search to an empty pathHiltjo Posthuma2022-01-031-0/+4
| | | | | | | Otherwise this would search outside the unveiled paths and cause an unveil violation. Reported by Anton Lindqvist, thanks!
* do not percent-encode: ',' or '-' or '.' it looks uglyHiltjo Posthuma2021-12-141-2/+2
|
* Print the number of remaining commitsQuentin Rameau2021-11-161-11/+16
|
* ignore '\r' in writing the blob aswellHiltjo Posthuma2021-11-161-2/+3
| | | | | Follow-up on commit 295e4b8cb95114bb74b582c7332bc4c171f36dd3 which changed it for diffs.
* percent encode characters in path namesHiltjo Posthuma2021-11-161-5/+27
| | | | Paths could contain characters like # (fragment), '?', control-characters, etc.
* encode the name, it could contain XML entitiesHiltjo Posthuma2021-11-161-4/+6
| | | | Like ", which would unquote the attribute value. Crazy but true.
* do not simplify the history by first-parentHiltjo Posthuma2021-05-051-2/+0
| | | | | | | | | | Reference: https://libgit2.org/libgit2/#HEAD/group/revwalk/git_revwalk_simplify_first_parent Noticed on merge commits on: https://git.simple-cc.org/scc/ Reported by quinq, thanks!
* tiny comment changeHiltjo Posthuma2021-03-251-1/+1
|
* add function to print a single line, ignoring \r and \nHiltjo Posthuma2021-03-251-1/+22
| | | | | | | This can happen when there is no newline at end of file in the diff which is served by libgit2 as: "\n\ No newline at end of file\n".
* change STAGIT_BASEURL to an -u option and also update the example scriptHiltjo Posthuma2021-03-051-4/+6
|
* add $STAGIT_BASEURL environment variable to make Atom links absoluteHiltjo Posthuma2021-03-051-2/+6
| | | | With feedback from adc, thanks!
* micro-optimization: fputc (function) -> putc (macro/inline function)Hiltjo Posthuma2021-01-091-7/+7
|
* fix warning with libgit2 v0.99+, remain compatible with older versionsHiltjo Posthuma2020-11-281-8/+7
| | | | | | | | | | | | | | | | | | | | git_blob_rawsize now returns with git_object_size_t (unsigned). This was git_off_t (signed). In my current version 1.1.0: types.h:typedef uint64_t git_object_size_t; v0.28.5: https://libgit2.org/libgit2/#v0.28.5/group/blob/git_blob_rawsize changed from v0.99 onwards: https://libgit2.org/libgit2/#v0.99.0/group/blob/git_blob_rawsize Fix: use size_t to remain compatible (with a possible warning in older versions), since git_object_size_t is a new defined type. This assumes size_t is atleast uint32_t / uint64_t size. Adapted from a patch by Augustin Fabre <[email protected]>, thanks!
* add abbreviated commit hash to submodule fileOscar Benedito2020-11-231-2/+5
|
* add meta viewport for scaling on mobileHiltjo Posthuma2020-11-151-0/+1
| | | | Patch by Augustin Fabre <[email protected]>
* use size_t to count linesHiltjo Posthuma2020-11-151-7/+7
|
* avoid shadowed `name' global variableHiltjo Posthuma2020-11-151-3/+3
| | | | by Augustin Fabre <[email protected]>
* refs_cmp: remove unneeded castHiltjo Posthuma2020-11-151-2/+1
|
* use LEN() macros for arraysHiltjo Posthuma2020-11-151-2/+4
| | | | from Augustin Fabre <[email protected]>
* fix a small memleak in writeatom()Hiltjo Posthuma2020-08-101-10/+6
| | | | non-tag references were not freed.
* fix submodule lookup in bare reposkst2020-08-061-3/+2
| | | | | | | | | | | | | | | git_submodule_lookup does not work without a working tree [1], so the current approach fails to recognize any submodules in bare repos. Instead, notice that $ git ls-tree HEAD lists any submodules as commit objects regardless of a working tree. This is the only instance commit object is used in a tree, so we will use this to check for submodules. [1]: https://github.com/libgit2/libgit2/pull/4305/files
* regression: do not show unset or empty tagsHiltjo Posthuma2020-07-201-1/+1
|
* refactor get reference, add another feed for tags/releasesHiltjo Posthuma2020-07-191-84/+142
| | | | | A separate Atom feed is helpful to ports maintainers to monitor new tags/releases.
* sort branches and tags by time (descending)Hiltjo Posthuma2020-07-191-72/+92
| | | | | | | In general version tags are done in chronological order, so this will have a better sorting for tagged (versioned) releases. Request from Caltlgin Stsodaat and others, thanks!
* atom.xml: improve output format a bitHiltjo Posthuma2020-02-211-2/+2
|
* improve includes, stagit-index does not need compat.hHiltjo Posthuma2020-02-121-1/+2
|
* add OpenBSD unveil supportHiltjo Posthuma2019-12-011-0/+7
| | | | | | | | | | | | The unveil() system call first appeared in OpenBSD 6.4. For stagit it has the following properties now: - stagit-index: only read-access to the file-system for the specified directories/repositories. - stagit: read-access to the specified directory/repository. read-write and creation access to the current directory for the output files. read-write and creation access to the specified cache file.
* escape HTML in pathsHiltjo Posthuma2019-03-161-4/+12
| | | | | - escape paths in diff line. - escape path in anchor href attribute in files.html
* pedantic snprintf() improvementHiltjo Posthuma2019-03-091-3/+3
| | | | | | POSIX says: "If an output error was encountered, these functions shall return a negative value and set errno to indicate the error."
* change order of commits in log from most recent to old to applied orderHiltjo Posthuma2019-02-161-2/+0
|
* fix compile: libgit2 0.28 changed giterr_last to git_error_lastHiltjo Posthuma2019-02-161-3/+1
| | | | | libgit2 commit: https://github.com/libgit2/libgit2/commit/a27a4de6f8003961d38958893c6c637395c7cc04
* in the diffstat prefix the type of change, allow CSS stylingHiltjo Posthuma2018-11-181-1/+16
|
* don't use a heuristic for renames, the content must match exactlyHiltjo Posthuma2018-11-181-1/+3
| | | | | this prevents showing files as renames when most (but not all) of the file was changed.
* detect filetype changes in diff (for example a normal file to symlink)Hiltjo Posthuma2018-11-181-1/+3
|
* detect more names for README and LICENSEHiltjo Posthuma2018-11-111-16/+30
| | | | | - for license: LICENSE, LICENSE.md, COPYING. - for readme: README, README.md.
* detect copies and renames based on the threshold of changesHiltjo Posthuma2018-11-111-0/+9
|
* simplify range checkHiltjo Posthuma2018-08-221-4/+1
|
* stagit: log: indicate when using the -l option and there are more commitsHiltjo Posthuma2018-08-221-0/+4
|
* assume OpenBSD 5.9+, always try pledge(2) on OpenBSDHiltjo Posthuma2018-05-251-4/+2
|
* Clarify usage regarding -c and -l mutual exclusionQuentin Rameau2018-05-091-1/+1
|
* pledge after git_libgit2_initHiltjo Posthuma2018-03-261-5/+8
| | | | | this is because libgit uses curl which uses some initialization checks, namely an IPv6 check which creates a socket.
* optimization: only diff the tree when it is needed for the diffstat...Hiltjo Posthuma2018-03-181-17/+27
| | | | | | | ... also clear all fields in the structure on failure. This is not as big an optimization as stagit-gopher, because the diffstat is displayed in the log, but the difference is still measurable.
* stagit: add -l option: limit the amount of commits for the log.html fileHiltjo Posthuma2018-01-211-12/+37
|
* fix: add "fattr" pledge for chmod(2) for cachefileHiltjo Posthuma2017-11-191-7/+5
| | | | improve checks for when head is NULL (empty repo)