Upgrade icons
[qgit4/redivivus.git] / README.adoc
blobc9141a7630b4109e7c77565b8fc4063170081d5a
1 qgit, a git GUI viewer
2 ======================
4 With qgit you will be able to browse revisions history, view patch content
5 and changed files, graphically following different development branches.
7 Bugs or feature requests should be sent to the git@vger.kernel.org
8 mailing list.
11 Main features
12 -------------
14  - View revisions, diffs, files history, files annotation, archive tree.
16  - Commit changes visually cherry picking modified files.
18  - Apply or save patch series from selected commits, drag and
19    drop commits between two instances of qgit.
21  - Associate commands sequences, scripts and anything else executable
22    to a custom action. Actions can be run from menu and corresponding
23    output is grabbed by a terminal window.
25  - qgit implements a GUI for the most common StGIT commands like push/pop
26    and apply/save patches. You can also create new patches or refresh
27    current top one using the same semantics of git commit, i.e. cherry
28    picking single modified files.
31 Installation
32 ------------
34 You need Qt developer libraries, version 5.11.0 or later, already installed.
35 Be sure compiler, qmake (Qt5 version) and Qt5 bin tools are in path.
37 NOTE: Correct qmake for Qt5 (/usr/lib/qt5/bin/qmake) must be called, in
38 case also Qt4 version is in path the former must be explicitly invoked.
40 To compile, install and start qgit:
42  - unpack the released tar file or clone from a git public archive
44  - (Windows only) open src/src.pro and set the proper GIT_EXEC_DIR value
46  - generate Makefiles (only the first time)
47    Unix/Linux and Windows:  qmake qgit.pro
48    Mac Os X:                qmake -spec macx-clang qgit.pro
50  - (Windows only with VC2008 IDE) open qgit.sln solution file
52  - make
54  - make install
56  - (Windows only) run start_qgit.bat to start the application. You can
57     also create a a desktop icon linked to 'start_qgit.bat' and double
58     click on it.
60 Installation directory is $HOME/bin under Linux and the directory of git
61 exe files under Windows.
63 You need to run 'qmake qgit.pro' only the first time to generate Makefile
64 files, then you simply call 'make' and  'make install'. You may need to
65 run 'qmake qgit.pro' again only after patches that modify 'qgit.pro' or
66 'src/src.pro' files or in case of 'strange' compile errors.
68 Remember to manually delete all Makefile* files in 'src/' directory before to
69 start 'qmake qgit.pro'.
72 Performance tweaks
73 ------------------
75 A 'git log' command is used to load the repository at startup or when
76 refreshing. This is an highly performance critical task. Default method is
77 based on a temporary file as data exchange facility. This is the fastest
78 on Linux with a tmpfs filesystem mounted under /tmp, as is common with most
79 distributions. In case of portability issues it is possible to fallback
80 on a standard QProcess based interface. To do this uncomment USE_QPROCESS
81 define in 'src/dataloader.h' before to compile.
84 Command line arguments
85 ----------------------
87 Run qgit from a git working directory, command line arguments
88 are filtered by 'git log'. Some examples:
90 [source,shell]
91 ------------------------------------------------------------------------------
92 qgit --no-merges
93 qgit v2.6.18.. include/scsi drivers/scsi
94 qgit --since="2 weeks ago" -- kernel/
95 qgit -r --name-status release..test
96 ------------------------------------------------------------------------------
98 If qgit is launched without arguments or if you change archive with
99 'open' menu, a dialog for range select is shown.
100 You can select top and bottom rev tags from the list or paste a
101 specific revision. Values are passed to 'git log' to narrow
102 data loading to chosen revisions.
104 As a special command-line argument, '--view-file foo' or '--view-file=foo' is
105 not passed to 'git log', but opens the file 'foo' in the QGit file viewer,
106 showing the history and the annotated ('blame') view for the file.
109 Main view
110 ---------
112 You can navigate through logs, file names, file history, archive tree.
113 All the views will be updated accordingly.
115 Copy/paste is supported on all fields. Copy (CTRL+C) is supported on
116 all views.
118 All the references found recursively under .git/refs/ directory are
119 highlighted according to their type: current branch(HEAD), branch, tag,
120 other. Reference names and any associated messages can be viewed in status
121 bar when a tagged revision is selected.
123 When you right click on main view a context sensitive pop-up menu is shows
124 available commands and a 'quick jump' tag list.
126 *Key bindings*::
128 |=============================================================================
129 |r             |Go to revisions list page
130 |p             |Go to patch page
131 |f             |Go to file page
132 |<Alt+wheel>   |Go to next/previous page
133 |t             |Toggle tree view
134 |s             |Toggle view of secondary panes
135 |h             |Toggle view of revision header
136 |<Home>        |Move to first revision
137 |<End>         |Move to last revision
138 |i             |Move up one revision in main view (global scope)
139 |n, k          |Move down one revision in main view (global scope)
140 |<Shift-Up>    |Move to previous highlighted line
141 |<Shift-Down>  |Move to next highlighted line
142 |<Left>        |Go back in history list
143 |<Right>       |Go forward in history list
144 |<CTRL-plus>   |Increase font size
145 |<CTRL-minus>  |Decrease font size
146 |<Delete>, b   |Scroll content up one page
147 |<Backspace>   |Scroll content up one page
148 |<Space>       |Scroll content down one page
149 |u             |Scroll content up 18 lines
150 |d             |Scroll content down 18 lines
151 |=============================================================================
153 *Directory tree*::
154 From menu or toolbar button it is possible to show a side panel with
155 tree view of repository files and directories.
157 Double clicking on a file opens file annotation window. With 'filter by tree'
158 button it is possible to compress revision list to show only selected
159 files/directories in tree view.
161 Tree view supports multi-selection. When you right click on a file on tree
162 view a context sensitive pop-up menu is shows with available commands.
164 *Working directory changes*::
165 When 'Check working dir' flag is set, as example from main view context
166 pop-up menu, a pseudo-revision is shown and highlighted at the top of the
167 list. Highlight and revision name reflect current working directory status:
168 'Nothing to commit' or 'Working directory changes' respectively.
170 To check for working directory modified files set corresponding preference in
171 Edit->Settings->'Working dir'. QGit checks for possible new files added in
172 working directory using ignoring rules according to git ls-files
173 specifications, see menu Edit->Settings->'Working dir'.
175 TIP: If you don't need to see modified files in working dir, disable
176 corresponding setting and start-up time will be shorter.
178 *Lane info*::
179 Selecting a lane with mouse right button will display a pop-up
180 with the list of children and parent. Select one and you jump to it.
182 *Filter / Highlight*::
183 Use the combo box to select where you want to filter or highlight on.
184 Currently supported fields are: log header, log message, revision author,
185 revision SHA1, file name and patch content.
187 Write a filter string, press filter button and the view
188 will update showing only commits that contain the filter string,
189 case insensitive. Toggle filter button to release the filter.
191 Alternatively press the magnifying glass button, in this case matched
192 lines will be highlighted, you can use <Shift-Up> and <Shift-Down>
193 keys to browse them. Toggle the button to remove the highlighting.
195 NOTE: In case of patch content regexp filtering, the given string is
196 interpreted as a POSIX regular expression, not as a simple substring.
198 TIP: Very useful to quick retrieve a sha writing only first 3-4
199 digits and filtering / highlighting on revision sha. The sha value
200 can then be copied from SHA field.
202 TIP: It is possible to insert an abbreviated sha directly in the
203 SHA line edit at the top right of the window. After pressing enter
204 this will trigger an higlighting of the matched revisions. It is
205 a kind of shortcut of the previous tip.
207 *Save patch series*::
208 After mouse selecting the chosen revisions (use standard CTRL+left click)
209 for single select or SHIFT+left click for range select), press 'Save
210 Patch' button or use file menu and a dialog will let you choose patches
211 destination directory. Then 'git format-patch-script' will be called and
212 patches created. It is possible to specify additional options with
213 Edit->Settings menu.
215 *Apply patch*::
216 This menu entry is complementary to save patch and it's an interface
217 to 'git am'.
219 *Drag and drop*::
220 It is possible to drag some selected revs from one instance of qgit to another
221 open on a different archive. In this case 'git format-patch' is used in the
222 dragging archive to create temporary patches imported in the dropping archive
223 by 'git am'.
225 *Make branch*::
226 Select a revision and open Edit->'Make Branch' or use right click context
227 pop-up menu. A dialog will be shown asking for a branch name.
229 *Make tag*::
230 Select a revision and open Edit->'Make Tag' or use right click context
231 pop-up menu. Two dialogs will be shown, the first asking for a tag name, the
232 second for a tag message (not mandatory). If a non empty message is written,
233 this will be saved together with the tag. Tags and tag messages can be viewed
234 in status bar when a tagged revision is selected.
236 *Delete tag*::
237 Select a tagged revision and open Edit->'Delete Tag' or use right click
238 context pop-up menu. After confirmation the selected revision will be
239 untagged.
241 *Save file*::
242 Select a file from tree or file list and open File->'Save file as' or use the
243 tree view context sensitive pop-up menu (right click), a dialog will be shown
244 asking for a file name (default to current) and destination directory. Input
245 a valid name, press OK and the file will be saved.
247 *Commit changes*::
248 When enabled with Edit->Settings->'Working dir'->'Diff against working dir'
249 and there is something committable, a special highlighted first revision is
250 shown, with the status of the archive and the possible pending stuff.
251 From Edit->Commit it is then possible to invoke the commit dialog.
253 In commit dialog select the files to commit or, simply, to sync with index
254 (call 'git update-index' on them). A proper commit message may be entered and,
255 after confirmation, changes are committed and a new revision is created.
257 It is also possible to amend last commit. The Edit->Amend commit opens the
258 same dialog, but changes are added to the head commit instead of creating new
259 commit.
261 The core commit function is performed by 'git commit'.
263 TIP: It is possible to use a template for commit message, use
264 Edit->Settings->Commit to define template file path.
267 Patch viewer
268 ------------
270 To open patch tab use context menu, double click on a revision or file in
271 main view or select View->'View patch' menu (CTRL+P). The patch shown is
272 the diff of current selected commit against:
274  - Parent (default)
275  - HEAD
276  - Selected SHA or reference name
278 In the last case SHA is chosen by writing or pasting a tree-ish or a reference
279 names in the corresponding field and pressing return. You get the same result
280 also with a CTRL+right click on a revision in main list. Selected target
281 will be highlighted. CTRL+right click again on the highlighted revision to
282 release the filter.
284 With the 'filter' button at the right of the tool bar it is possible to
285 toggle the display of removed code lines. This can be useful to easy
286 reading of the patch.
289 External diff tool
290 ------------------
292 From 'View->External diff' it is possible to invoke an external diff tool,
293 as example to view the diffs in a two vertical tiled windows.
295 External diff tool shows the diffs between two files.
296 First file is the current selected file of current revision.
297 Second file is the same file of the parent revision or of a specific revision
298 if 'diff to sha' feature is enabled (diff target is highlighted, see above).
300 Default external viewer is kompare, but it is possible to set a preferred one
301 from 'Edit->Settings->External Diff Tool'.
304 File viewer
305 -----------
307 It is possible to view file contents of any file at any revision time in
308 history.
310 *File list panel*::
311 In the bottom right of main view a list of files modified by current
312 revision is shown. Selecting a file name will update the patch view
313 to center on the file. File names colors use the following convention
315  - black for modified files
316  - green for new files
317  - red for removed files
318  - dark blue for renamed/copied files
320 *Merge files*::
321 In case of merges the groups of files corresponding to each merge parent
322 are separated by two empty lines.
324 In case of merges you can chose between to see all the merge files or only
325 the interesting ones (default), i.e. the files modified by more then one
326 merge parent.
328 *File content*::
329 To view file content double click on a file name in tree view, or use context
330 menu in file list or select View->'View file' menu (CTRL+A).
332 In file view page will be shown current revision's file content and file
333 history.
335 It is possible to copy to the clipboard the selected content with CTRL+C or
336 with the corresponding button.
338 *File annotations*::
339 On opening or updating file viewer, file history will be retrieved from archive
340 together with file content. Annotations are then calculated in background
341 and the view is updated when ready.
343 Double clicking on an annotation index number will update history list
344 to point to corresponding revision.
346 Hovering the mouse over an annotation index will show a tool tip with the
347 corresponding revision description.
349 File content will change too, to show new selected revision file. To keep
350 the same view content after double clicking, probably what you want, just pin
351 it with 'Pin view' check button. Next to the check button there is a spinbox
352 to show/select the current revision number.
354 Double click on history list entry to update main, patch and tree views to
355 corresponding revision.
357 *Code region filter*::
358 When annotation info is available the 'filter' button is enabled and it is
359 possible to mouse select a region of file content. Then, when pressing
360 the filter button, only revisions that modify the selected region will be
361 visible. Selected code region is highlighted and a shrunken history is
362 shown. Filter button is a toggle button, so just press it again to
363 release the filter.
365 *Syntax highlighter*::
366 If GNU Source-highlight (http://www.gnu.org/software/src-highlite/) is
367 installed and in PATH then it is possible to toggle source code highlight
368 pressing the 'Color text' tool button. Please refer to Source-highlight
369 site for the list of supported languages and additional documentation.
372 Actions
373 -------
375 Actions can be added/removed using a dedicated dialog invoked
376 from 'Actions->Setup actions...' menu. Actions can be activated
377 clicking on their name from the Actions menu.
379 Each action can be associated to a list of any type of git or shell
380 commands or to an external script.
382 While an action is running a terminal window is shown to display the
383 corresponding output.
385 An action can also ask for command line arguments before to run so
386 to allow for maximum flexibility.
388 NOTE: command line arguments are always appended to the first command only.
389 This lets you define an action like:
391 [source,shell]
392 ------------------------------------------------------------------------------
393 git fetch
394 git merge
395 ------------------------------------------------------------------------------
397 And if you type 'origin' when prompted, the action executed will be:
399 [source,shell]
400 ------------------------------------------------------------------------------
401 git fetch origin
402 git merge
403 ------------------------------------------------------------------------------
405 If you need a more complex arguments passing with a shell like notation
406 define a script and associate your action to it.
409 Integration with StGIT
410 ----------------------
412 When a StGIT stack is found on top of a git archive, qgit transparently
413 handles the added information.
415 Integration with StGIT is implemented both by new and modified functions.
417 .New functions are automatically activated:
419  - Visualization of applied and unapplied patches in main view.
420  - Interface to push/pop patches by a mouse right click on selected items.
421    Push supports also multi-selection.
423 .Existing functions change behavior:
425  - Amend commit dialog refreshes top stack patch with modified files instead
426    of amending the commit. It is appropriately renamed in the menu.
427  - Commit dialog creates a new patch on the top of the stack filled with
428    modified working directory content instead of commit a new revision to
429    git repository.
430  - Apply patch changes to interface StGIT import and fold commands instead
431    of applying patch directly on the git repository.