Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From 0.13 To 0.14
2023-04-17 15:29 | bump version number: 0.15 (check-in: c6cd3983d8 user: mark tags: trunk) | |
2023-04-17 14:10 | CHANGES for 0.14 (check-in: 571ae0eed4 user: mark tags: trunk, 0.14) | |
2023-04-17 13:40 | latest upstream libfossil: 9a8269d737 (check-in: b324288c18 user: mark tags: trunk) | |
2022-11-26 06:01 | bump version number: 0.14 (check-in: be94040192 user: mark tags: trunk) | |
2022-11-26 06:00 | CHANGES for 0.13 (check-in: 0b85faeb8a user: mark tags: trunk, 0.13) | |
2022-11-25 05:15 | latest upstream libfossil: 46008704a620 (check-in: f745a2bcb8 user: mark tags: trunk) | |
Changes to CHANGES.md.
|
Changes to fnc.bld.mk.
1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | - + | # # FNC Common Build # # CONFIGURATION CC ?= cc PREFIX ?= /usr/local MANDIR ?= /share/man |
︙ |
Changes to include/diff.h.
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - + - - - - - - + + + + + + + - | * Flags set by callers of the below diff APIs to determine diff output. */ enum fnc_diff_flag { FNC_DIFF_IGNORE_EOLWS = 0x01, FNC_DIFF_IGNORE_ALLWS = 0x03, FNC_DIFF_SIDEBYSIDE = 1 << 2, /* output side-by-side diff */ FNC_DIFF_VERBOSE = 1 << 3, /* show added/rm'd file content */ |
︙ |
Changes to include/settings.h.
︙ | |||
81 82 83 84 85 86 87 88 89 90 91 92 93 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | + + + + + + - + + | _(pfx, DIFF_HUNK), \ _(pfx, DIFF_SEPARATOR) #define VIEW_MODE_ENUM(pfx, _) \ _(pfx, NONE), \ _(pfx, VERT), \ _(pfx, HRZN) #define STASH_MVMT_ENUM(pfx, _) \ _(pfx, NONE), \ _(pfx, DOWN), \ _(pfx, UP), \ _(pfx, UPDOWN) #define ENUM_INFO(_) \ _(fnc_opt_id, FNC, USER_OPTIONS) \ _(line_attr, SLINE, LINE_ATTR_ENUM) \ _(input_type, INPUT, INPUT_TYPE_ENUM) \ _(line_type, LINE, LINE_TYPE_ENUM) \ |
Changes to lib/libfossil-config.h.
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | - - - + + + | #if !defined(HAVE_STDINT_H) # define HAVE_STDINT_H 1 #endif #endif /* _WIN32 */ |
︙ |
Changes to lib/libfossil.c.
︙ | |||
6512 6513 6514 6515 6516 6517 6518 | 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 | + + + + + + + + + + + - + | "CASE vmerge.id WHEN -1 THEN '+' ELSE '-' END || mhash," " merge" " FROM vmerge" " WHERE (vmerge.id=-1 OR vmerge.id=-2)" " ORDER BY 1"); while( !rc && (FSL_RC_STEP_ROW==fsl_stmt_step(&q)) ){ fsl_id_t const mid = fsl_stmt_g_id(&q, 1); /* The is-private check is taken from: https://fossil-scm.org/home/info/52a66829d655ff35dc52: noting that that patch also has (!g.markPrivate), a flag we do not currently have in fsl_cx but perhaps should, so that we can flag privacy at a higher level when doing a checkin. As of this writing (2023-02-02), we do not have any infrastructure for making private checkins. */ |
︙ | |||
14302 14303 14304 14305 14306 14307 14308 | 14313 14314 14315 14316 14317 14318 14319 14320 14321 14322 14323 14324 14325 14326 14327 14328 14329 | - - + + + | void fsl_cx_caches_reset(fsl_cx * const f){ fsl__bccache_reset(&f->cache.blobContent); fsl__cx_mcache_clear(f); fsl__cx_clear_mf_seen(f, false); f->cache.allowSymlinks = f->cache.caseInsensitive = |
︙ | |||
14618 14619 14620 14621 14622 14623 14624 | 14630 14631 14632 14633 14634 14635 14636 14637 14638 14639 14640 14641 14642 14643 14644 | - + | break; default: fsl__fatal(FSL_RC_ERROR, "Cannot happen. Really."); } fsl__cx_finalize_cached_stmt(f); fsl__db_cached_clear_role(f->dbMain, r) /* Make sure that we destroy any cached statements which are |
︙ | |||
14759 14760 14761 14762 14763 14764 14765 | 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 | + - + - + | if(fsl_cx_transaction_level(f)){ /* TODO???: force a full rollback and close it */ //if(f->repo.db.dbh) fsl_db_rollback_force(&f->repo.db); //if(f->ckout.db.dbh) fsl_db_rollback_force(&f->ckout.db); return fsl_cx_err_set(f, FSL_RC_MISUSE, "Cannot close repo or checkout with an " "opened transaction."); } |
︙ | |||
15121 15122 15123 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 | 15134 15135 15136 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 15148 | + | /** To be called after a repo or checkout/repo combination has been opened. This updates some internal cached info based on the checkout and/or repo. */ static int fsl_cx_after_open(fsl_cx * f){ f->cache.searchIndexExists = -1; int rc = fsl__ckout_version_fetch(f); if(!rc) rc = fsl_cx_load_glob_lists(f); return rc; } static void fsl_cx_fetch_hash_policy(fsl_cx * f){ |
︙ | |||
35250 35251 35252 35253 35254 35255 35256 | 35264 35265 35266 35267 35268 35269 35270 35271 35272 35273 35274 35275 35276 35277 35278 35279 35280 35281 35282 35283 35284 35285 35286 35287 35288 35289 | - + - + | if(!rc){ rc = fsl_db_exec(db, "UPDATE user SET cap='s', pw=lower(hex(randomblob(3)))" " WHERE login=%Q", defaultUser); if( !rc && !addOnlyUser ){ fsl_db_exec_multi(db, "INSERT OR IGNORE INTO user(login,pw,cap,info)" |
︙ | |||
36974 36975 36976 36977 36978 36979 36980 | 36988 36989 36990 36991 36992 36993 36994 36995 36996 36997 36998 36999 37000 37001 37002 37003 37004 37005 37006 37007 37008 37009 37010 37011 37012 37013 37014 37015 37016 37017 37018 37019 37020 37021 37022 37023 37024 37025 37026 37027 37028 37029 37030 37031 37032 37033 37034 37035 37036 37037 37038 37039 37040 37041 37042 37043 37044 37045 37046 37047 37048 37049 37050 37051 37052 37053 37054 37055 37056 37057 37058 37059 37060 37061 37062 37063 37064 37065 37066 37067 37068 37069 37070 37071 37072 37073 37074 37075 37076 | + + + + + + - - - + + + + + + - - - - - + + + + + + + + + + - + + - + + + - - + + - + - + - + - + | /* Only for debugging */ #define MARKER(pfexp) \ do{ printf("MARKER: %s:%d:%s():\t",__FILE__,__LINE__,__func__); \ printf pfexp; \ } while(0) /** Returns 0 if f has no search index or a repo is not opened, else 4 for an FTS4 index and 5 for an FTS5. If forceRecheck is false then a cached values is returned after the first call. If forceRecheck is true, the cached value is updated. */ |
︙ |
Changes to lib/libfossil.h.
︙ | |||
11908 11909 11910 11911 11912 11913 11914 | 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 | - - - + + + - - + + | /** Adds a Q-card record to the given deck. The type argument must be negative for a backed-out change, positive for a cherrypicked change. target must be a valid UUID string. If baseline is not NULL then it also must be a valid UUID. |
︙ | |||
15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 | 15992 15993 15994 15995 15996 15997 15998 15999 16000 16001 16002 16003 16004 16005 16006 16007 16008 16009 | + + + + | fsl_checkin_queue_f callback; /** Opaque client-side state for use as the 2nd argument to this->callback. */ void * callbackState; /* TODO (2023-02-02): any state necessary for indicating that this checking should be flagged as "private". */ }; /** Convenience typedef. */ typedef struct fsl_checkin_queue_opt fsl_checkin_queue_opt; /** Initialized-with-defaults fsl_checkin_queue_opt structure, intended for const-copy initialization. */ |
︙ |
Deleted signify/fnc-12-release.pub.
| - - |
|
Added signify/fnc-14-release.pub.
|
Changes to src/diff.c.
︙ | |||
96 97 98 99 100 101 102 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | - + | struct diff_out_state { fsl_output_f out; /* Output callback */ void *state; /* State for this->out() */ enum line_type *lines; /* Diff line type (e.g., minus, plus) */ uint32_t nlines; /* Index into this->lines */ int rc; /* Error reporting */ char ansi; /* ANSI colour code */ |
︙ | |||
130 131 132 133 134 135 136 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | - + - | fsl_output_f, void *, enum line_type **, uint32_t *, /* void *regex, */ uint16_t, short, int, int **); static int fnc_output_f_diff_out(void *, void const *, fsl_size_t); static int diff_outf(struct diff_out_state *, char const *, ... ); static int diff_out(struct diff_out_state * const, void const *, fsl_int_t); static int validate_scope_line(const char *); |
︙ | |||
648 649 650 651 652 653 654 | 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 | - - + + - - + + + + + + + + + - - - - - + + + + + + + + + + - - + - - + - - - + + - + | * Starting from seek lines, copy n lines from src to dst. The seek starts * from offset bytes into src->mem. This routine does _not_ modify src. */ static int buffer_copy_lines_from(fsl_buffer *const dst, const fsl_buffer *const src, fsl_size_t *offset, fsl_size_t seek, fsl_size_t n) { |
︙ | |||
707 708 709 710 711 712 713 | 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 | - + - + - - + + - - - - + + + + - - - - + + - - + + - - + + + + - - + + - - + + - + | /* * Back scan the diffed file dst->proto.file from line pos, which is the first * changed line of the current hunk, for the enclosing function in which the * hunk resides. Point dst->proto.sig to the heap-allocated matching line, * which the caller must eventually free. Return FSL_RC_OK on success. */ static int |
︙ | |||
1363 1364 1365 1366 1367 1368 1369 | 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 | + - + - + - + - - - + + + - - - + + - | if (html) { rc = diff_outf(dst, "</span>"); if (rc) return rc; } if (proto && li + skip > 1) { struct hunk_scope *hs = &dst->proto; |
︙ |
Changes to src/fnc.1.
︙ | |||
165 166 167 168 169 170 171 | 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | - - + + - + | .Ar setting , otherwise .Nm will display the current value of .Ar setting . With no arguments, .Nm Cm config |
︙ |
Changes to src/fnc.c.
︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | - - - - - - | #include <sys/queue.h> #include <sys/ioctl.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> |
︙ | |||
564 565 566 567 568 569 570 | 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | - + | fcli_cliflag_empty_m }, /* End cliflags_blame. */ { /* cliflags_config config command related options. */ FCLI_FLAG_BOOL("h", "help", NULL, "Display config command help and usage."), FCLI_FLAG_BOOL(NULL, "ls", &fnc_init.lsconf, |
︙ | |||
802 803 804 805 806 807 808 | 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 | - - - + + + + - - - - - + + + | struct commit_queue commits; struct commit_entry *first_commit_onscreen; struct commit_entry *last_commit_onscreen; struct commit_entry *selected_entry; struct commit_entry *matched_commit; struct commit_entry *search_commit; struct fnc_colours colours; |
︙ | |||
1144 1145 1146 1147 1148 1149 1150 | 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 | - + - + - + | static int write_commit_line(struct fnc_view *, struct fnc_commit_artifact *, int); static int view_input(struct fnc_view **, int *, struct fnc_view *, struct view_tailhead *); static int cycle_view(struct fnc_view *); static int toggle_fullscreen(struct fnc_view **, struct fnc_view *); |
︙ | |||
1205 1206 1207 1208 1209 1210 1211 | 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 | - - + + - | static int diff_file(struct fnc_diff_view_state *, fsl_buffer *, const char *, const char *, fsl_uuid_cstr, const char *, const fsl_ckout_change_e); static int diff_non_checkin(struct fnc_diff_view_state *); static int diff_file_artifact(struct fnc_diff_view_state *, fsl_id_t, const fsl_card_F *, const fsl_card_F *, const fsl_ckout_change_e); |
︙ | |||
1234 1235 1236 1237 1238 1239 1240 | 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 | - - - + + + | static int fnc_stash_get(bool); static int select_hunks(struct fnc_view *); static int stash_input_handler(struct fnc_view *, bool *); static void set_choice(struct fnc_diff_view_state *, bool *, struct input *, struct index *, uint32_t *, size_t *, size_t *, bool *, enum stash_opt *); static unsigned char *alloc_bitstring(size_t); |
︙ | |||
1389 1390 1391 1392 1393 1394 1395 | 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 | - + | static bool view_is_parent(struct fnc_view *); static void view_set_child(struct fnc_view *, struct fnc_view *); static int view_close_child(struct fnc_view *); static int close_tree_view(struct fnc_view *); static int close_timeline_view(struct fnc_view *); static int close_diff_view(struct fnc_view *); static void free_index(struct index *, bool); |
︙ | |||
1421 1422 1423 1424 1425 1426 1427 | 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 | - - + + | static bool fnc_str_has_upper(const char *); static int fnc_make_sql_glob(char **, char **, const char *, bool); static const char *gettzfile(void); #ifndef HAVE_LANDLOCK static int init_unveil(const char **, const char **, int, bool); #else |
︙ | |||
1452 1453 1454 1455 1456 1457 1458 | 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 | - - - - - + - - - + + - - + - | int main(int argc, const char **argv) { const fcli_command *cmd = NULL; char *path = NULL; int rc = FSL_RC_OK; |
︙ | |||
1807 1808 1809 1810 1811 1812 1813 | 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 | - - - - - - - - | rc = RC(FSL_RC_RANGE, "strlcpy"); fsl_free(*child); *child = NULL; } return rc; } |
︙ | |||
1924 1925 1926 1927 1928 1929 1930 | 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 | - - - - - - - - - - - - - - + + - - - + | if (path != s->path) { fsl_free(s->path); s->path = fsl_strdup(path); if (s->path == NULL) return RC(FSL_RC_ERROR, "fsl_strdup"); } |
︙ | |||
2713 2714 2715 2716 2717 2718 2719 | 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 | - + | /* FALL THROUGH */ default: break; } } if ((idxstr = fsl_mprintf("%s [%d/%d] %s", |
︙ | |||
2813 2814 2815 2816 2817 2818 2819 2820 2821 | 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 | + + + + - + - + - + - + | entry = TAILQ_NEXT(entry, entries); } ncommits = 0; entry = s->first_commit_onscreen; s->last_commit_onscreen = s->first_commit_onscreen; while (entry) { struct timeline_tag *t = &s->tag; if (ncommits >= MIN(view->nlines - 1, view->lines - 1)) break; if ((t->one && !t->two && entry->commit == t->one) || |
︙ | |||
3243 3244 3245 3246 3247 3248 3249 | 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 | - - - - - + + + + + + + + + + + | break; case KEY_F(1): case 'H': case '?': rc = help(view); break; case 'q': |
︙ | |||
3357 3358 3359 3360 3361 3362 3363 | 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 | - + - - + + - - - + + + | rc = offset_selected_line(view); } return rc; } static int |
︙ | |||
3614 3615 3616 3617 3618 3619 3620 | 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 | - + | /* * Create popup pad in which to write the supplied txt string and optional * title. The pad is contained within a window that is offset four columns in * and two lines down from the parent window. */ static int padpopup(struct fnc_view *view, const char *keys[][2], const char **desc, |
︙ | |||
3636 3637 3638 3639 3640 3641 3642 | 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 | - - + + + + + - + | /* * Format help text, and compute longest line and total number of * lines in text to be displayed to determine pad dimensions. */ width = fsl_strlen(title); for (ln = 0; keys[ln][0]; ++ln) { |
︙ | |||
3792 3793 3794 3795 3796 3797 3798 | 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 | - - | static int tl_input_handler(struct fnc_view **new_view, struct fnc_view *view, int ch) { struct fnc_tl_view_state *s = &view->state.timeline; int rc = FSL_RC_OK; uint16_t nscroll = view->nlines - 2; |
︙ | |||
3864 3865 3866 3867 3868 3869 3870 | 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 | + + - - + + - - + + + + - - + - - - - - - + + + + + + + - - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + + + | !s->thread_cx.eotl) { s->thread_cx.ncommits_needed += (view->nlines - 1) - s->commits.ncommits; rc = signal_tl_thread(view, 1); } break; case 'C': { fsl_cx *const f = fcli_cx(); |
︙ | |||
3918 3919 3920 3921 3922 3923 3924 3925 3926 | 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 | + - + - - + + + + + + + + + + + + + - - + + - - - - - + - - + + - - - - - - - + + + + + - - - - - + - - + + + + + - - + + + + + - - + + + + + + + - - - + + + + + + - + | rc = sitrep(view, SR_ALL, "-- no matching commits --"); } break; } case 't': if (s->selected_entry == NULL) break; if (!fsl_rid_is_a_checkin(fcli_cx(), s->selected_entry->commit->rid)) |
︙ | |||
4602 4603 4604 4605 4606 4607 4608 | 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 | - + - + - + - + - - - - - - - - - - - - - - | return rc; } static int close_timeline_view(struct fnc_view *view) { struct fnc_tl_view_state *s = &view->state.timeline; |
︙ | |||
4748 4749 4750 4751 4752 4753 4754 | 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 | - - | set_diff_opt(s); s->index.n = 0; s->index.idx = 0; s->hundex.n = 0; s->paths = paths; s->selected_entry = commit; |
︙ | |||
4782 4783 4784 4785 4786 4787 4788 | 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 | - + | rc = create_diff(s); if (rc) { if (s->colour) free_colours(&s->colours); return rc; } |
︙ | |||
4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 | 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 | + + | static void set_diff_opt(struct fnc_diff_view_state *s) { char *opt; char ch; long ctx = DEF_DIFF_CTX; int i = 0; FLAG_SET(s->diff_flags, FNC_DIFF_STRIP_EOLCR); /* Command line options. */ fnc_init.verbose ? FLAG_SET(s->diff_flags, FNC_DIFF_VERBOSE) : 0; fnc_init.proto ? FLAG_SET(s->diff_flags, FNC_DIFF_PROTOTYPE) : 0; fnc_init.ws ? FLAG_SET(s->diff_flags, FNC_DIFF_IGNORE_ALLWS) : 0; fnc_init.eol ? FLAG_SET(s->diff_flags, FNC_DIFF_IGNORE_EOLWS) : 0; fnc_init.invert ? FLAG_SET(s->diff_flags, FNC_DIFF_INVERT) : 0; |
︙ | |||
4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 | 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 | + + + + + + + + + + + + + + + + + + + + + + + + | if (!rc && s->diff_mode == COMMIT_META) rc = write_commit_meta(s); if (!rc && s->selected_entry->diff_type == FNC_DIFF_WIKI) rc = diff_non_checkin(s); if (rc) goto end; /* * diff headline label (i.e., diff id1 id2) assignment is delayed till * now because wiki parent commits are obtained in diff_non_checkin() */ if (s->selected_entry->puuid) { fsl_free(s->id1); s->id1 = fsl_strdup(s->selected_entry->puuid); if (s->id1 == NULL) { rc = RC(FSL_RC_ERROR, "fsl_strdup"); goto end; } } else s->id1 = NULL; /* initial commit, tag, technote, etc. */ if (s->selected_entry->uuid) { fsl_free(s->id2); s->id2 = fsl_strdup(s->selected_entry->uuid); if (s->id2 == NULL) { rc = RC(FSL_RC_ERROR, "fsl_strdup"); goto end; } } else s->id2 = NULL; /* local work tree */ if (s->diff_mode != COMMIT_META) { s->index.offset = fsl_realloc(s->index.offset, (s->index.n + 1) * sizeof(off_t)); s->index.offset[s->index.n++] = 0; } /* |
︙ | |||
6184 6185 6186 6187 6188 6189 6190 | 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 | - + - - - - - - - - - - - - - - - - - + - - - - + - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - | fsl_free(xplus0); fsl_buffer_clear(&fbuf1); fsl_buffer_clear(&fbuf2); return rc; } static int |
︙ | |||
6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 | 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | wstandout(view->window); waddstr(view->window, "(END)"); wstandend(view->window); } return rc; } static int draw_diff_headln(struct fnc_view *view) { struct fnc_diff_view_state *s = &view->state.diff; wchar_t *wstr; const char *id1, *id2; char hdr[view->ncols + 1], pct[MAX_PCT_LEN]; double percent; fsl_size_t len = 0; int col, dlen, ln, n, npct, rc; attr_t rx = 0; bool wt = false; ln = s->gtl ? s->gtl : s->lineno + s->selected_line; percent = 100.00 * ln / s->nlines; npct = snprintf(pct, MAX_PCT_LEN, "%.*lf%%", percent > 99.99 ? 0 : 2, percent); if (npct < 0 || npct >= MAX_PCT_LEN) return RC(FSL_RC_RANGE, "snprintf"); /* some diffs (e.g., technote, tag) have no parent hash to display */ id1 = s->id1 ? s->id1 : "/dev/null"; /* if diffing the work tree, display work tree path (trim trailing /) */ if (s->selected_entry->diff_type == FNC_DIFF_CKOUT || fsl_strcmp(s->id1, s->id2) == 0) { id2 = fsl_cx_ckout_dir_name(fcli_cx(), &len); wt = true; } else if (s->id2) id2 = s->id2; else id2 = "/dev/null"; dlen = len; n = snprintf(hdr, view->ncols + 1, "[%d/%zu] diff %.40s %.*s", ln, s->nlines, id1, wt ? dlen - 1 : 40, id2); if (n < 0) /* ignore truncation */ return RC(FSL_RC_RANGE, "snprintf"); rc = formatln(&wstr, &n, hdr, view->ncols, 0, false); if (rc) return rc; if (screen_is_shared(view) || view->active) rx = FNC_HIGHLIGHT; wattron(view->window, rx); waddwstr(view->window, wstr); fsl_free(wstr); col = n; while (col++ < view->ncols) waddch(view->window, ' '); if (n < view->ncols - npct) mvwaddstr(view->window, 0, view->ncols - npct, pct); wattroff(view->window, rx); return FSL_RC_OK; } static bool screen_is_shared(struct fnc_view *view) { if (view_is_parent(view)) { if (view->child == NULL || view->child->active || !screen_is_split(view->child)) |
︙ | |||
6489 6490 6491 6492 6493 6494 6495 | 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 | - - - | } static int diff_input_handler(struct fnc_view **new_view, struct fnc_view *view, int ch) { struct fnc_view *branch_view; struct fnc_diff_view_state *s = &view->state.diff; |
︙ | |||
6762 6763 6764 6765 6766 6767 6768 6769 | 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 | + + + + - - + + - - + + - + + + + - + + + + + + - + + + - - - + + - - + | /* FALL THROUGH */ case CTRL('k'): case '<': case ',': case 'K': if (s->parent_view == NULL) break; if (s->parent_view->vid == FNC_VIEW_TIMELINE) { struct fnc_tl_view_state *ts; struct commit_entry *prev; |
︙ | |||
7218 7219 7220 7221 7222 7223 7224 | 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 | + + + + + + + + + + - - - + + + + + + | /* 3. revert ckout to apply patches; vfile scanned in cmd_stash() */ rc = revert_ckout(true, false); if (rc) { rc = RC(rc, "revert_ckout"); goto end; } /* * XXX Older landlock versions do not allow file reparenting (i.e., * linking and renaming files into different directories). This makes * landlock unusable with our interactive stash implementation (see * apply_patch()) where patches are made to a temporary file in the * work tree root and renamed into the versioned file, which could be * in any number of project subdirectories. Disable landlock support * for the stash command until the newer landlock is ubiquitous. */ #ifndef HAVE_LANDLOCK |
︙ | |||
7280 7281 7282 7283 7284 7285 7286 7287 | 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 | + + - - + + - - + | static int select_hunks(struct fnc_view *view) { int rc = FSL_RC_OK; bool stashing = false; rc = stash_input_handler(view, &stashing); if (rc && rc != FSL_RC_BREAK) return rc; |
︙ | |||
7319 7320 7321 7322 7323 7324 7325 | 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 | - + - - - - - + + + + + | uint32_t *nh; int hl, rc = FSL_RC_OK; enum stash_opt choice = NO_CHOICE; bool lastfile = false; hunks = &s->hundex; nh = &hunks->idx; |
︙ | |||
7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 | 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 | + + + - - - + + + - - - + + + - - - - + + - - + + - - + - - - - + + + + + + + - - + + + + - - - - + + + + - + + - + - - + + - - + - + - - + - + - - - + - - + + - - - + + - - - + + - - - - + + + - - - - - + + + + - - - + - - - + - - - + - - + + - - - + - + - + | s->first_line_onscreen = hunks->lineno[*nh] - 5; s->selected_line = 1; hl = s->first_line_onscreen; /* current hunk start line */ redraw: rc = view->show(view); if (rc) return rc; updatescreen(view->window, true, true); keypad(view->window, false); /* don't accept arrow keys */ memset(prompt, '\0', sizeof(prompt)); last = s->last_line_onscreen; len = snprintf(prompt, sizeof(prompt), "[%u/%u] stash this hunk (", hunks->idx + 1, hunks->n); if (len < 0 || (len > 0 && (size_t)len >= sizeof(prompt))) |
︙ | |||
7532 7533 7534 7535 7536 7537 7538 | 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 | - - - - - - - - - - | while (*nf < files->n - 1 && *nh < hunks->n - 1 && files->lineno[*nf] + 5 <= hunks->lineno[*nh + 1]) ++(*nf); ++(*nh); } |
︙ | |||
8669 8670 8671 8672 8673 8674 8675 | 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | fsl_free(h->lines); fsl_free(h); h = NULL; } fsl_free(p); } |
︙ | |||
9034 9035 9036 9037 9038 9039 9040 | 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 | + - - + + + + + + + + + + + + - + | return rc; } static int set_selected_commit(struct fnc_diff_view_state *s, struct commit_entry *entry) { fsl_free(s->id2); |
︙ | |||
9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 | 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 | + + + + | close_diff_view(struct fnc_view *view) { struct fnc_diff_view_state *s = &view->state.diff; int rc = 0; if (s->f && fclose(s->f) == EOF) rc = RC(fsl_errno_to_rc(errno, FSL_RC_IO), "fclose"); fsl_free(s->id1); s->id1 = NULL; fsl_free(s->id2); s->id2 = NULL; fsl_free(s->line_offsets); free_colours(&s->colours); s->line_offsets = NULL; s->nlines = 0; free_index(&s->index, true); free_index(&s->hundex, false); fsl_free(s->dlines); |
︙ | |||
9211 9212 9213 9214 9215 9216 9217 | 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 | - - + + + + - - + + + + + + + - - + + - - + + - - - - - + + + - + - - - - - + + + + + + + | index->n = 0; fsl_free(index->lineno); index->lineno = NULL; fsl_free(index->offset); index->offset = NULL; } |
︙ | |||
9629 9630 9631 9632 9633 9634 9635 9636 | 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 | + + + - - - + + + + - + | commit->uuid = fsl_strdup(commit->puuid); commit->type = fsl_strdup("checkin"); commit->diff_type = diff_type; rc = init_curses(); if (rc) goto end; /* XXX see comment in fnc_stash() for why landlock is disabled */ #ifndef HAVE_LANDLOCK /* |
︙ | |||
9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 | 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 | + + - + + + + + | */ static int valid_path(const char *path, const char *sym) { fsl_cx *const f = fcli_cx(); fsl_deck d = fsl_deck_empty; const fsl_card_F *cf; fsl_uuid_str id; fsl_id_t rid; int rc; bool valid = false; |
︙ | |||
9873 9874 9875 9876 9877 9878 9879 | 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 | - - + + + | valid = true; } while (cf && !valid); end: fsl_deck_finalize(&d); if (!valid && !rc) |
︙ | |||
10253 10254 10255 10256 10257 10258 10259 | 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 | - - - - - - - - - - - - - - - - - - - - - - - - - - | te->idx = i++; } (*tree)->nentries = i; return FSL_RC_OK; } |
︙ | |||
11287 11288 11289 11290 11291 11292 11293 | 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 | - + | return rc; opt = fcli_next_arg(true); if (opt == NULL || fnc_init.lsconf) { if (fnc_init.unset) return RC(FSL_RC_MISSING_INFO, "-u|--unset requires <setting>"); |
︙ | |||
11329 11330 11331 11332 11333 11334 11335 | 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 | - + | last = (value = fnc_conf_getopt(idx, true)) ? idx : last; maxlen = MAX(fsl_strlen(fnc_opt_name[idx]), maxlen); fsl_free(value); } if (!last && !all) { f_out("No user-defined settings: " |
︙ | |||
14008 14009 14010 14011 14012 14013 14014 | 14027 14028 14029 14030 14031 14032 14033 14034 14035 14036 14037 14038 14039 14040 14041 | - + | #endif /* * Similar to unveil(), grant read and write permissisions to the repo and * ckout files, and create permissions to the ckout, repo, and tmp dirs. */ static int |
︙ |